Browse Source

HOT-FIX: Fix botões de Marcar/Desmarcar todos (#2620)

* HOTFIX - Fix botões de check all

* HOTFIX - Fix botões de check all
pull/2624/head
Cesar Augusto de Carvalho 6 years ago
committed by Edward
parent
commit
32891fcd7c
  1. 15
      sapl/templates/materia/em_lote/acessorio.html
  2. 15
      sapl/templates/materia/em_lote/anexada.html
  3. 15
      sapl/templates/materia/em_lote/tramitacao.html
  4. 37
      sapl/templates/sessao/votacao/votacao_bloco_expediente.html
  5. 37
      sapl/templates/sessao/votacao/votacao_bloco_ordem.html

15
sapl/templates/materia/em_lote/acessorio.html

@ -79,7 +79,7 @@
<div class="controls"> <div class="controls">
<div class="checkbox"> <div class="checkbox">
<label for="id_check_all"> <label for="id_check_all">
<input type="checkbox" id="id_check_all" onchange="checkAll(event)" /> Marcar/Desmarcar Todos <input type="checkbox" id="id_check_all" onchange="checkAll(this)" /> Marcar/Desmarcar Todos
</label> </label>
</div> </div>
</div> </div>
@ -109,11 +109,12 @@
{% endblock detail_content %} {% endblock detail_content %}
{% block extra_js %} {% block extra_js %}
<script language="JavaScript"> <script language="JavaScript">
function checkAll(event) { function checkAll(elem) {
$('[name=materia_id]').each(function() { let checkboxes = document.getElementsByName('materia_id');
$(this).prop('checked', event.target.checked ? 'checked': null); for (let i = 0; i < checkboxes.length; i++) {
$(this).trigger('click'); if (checkboxes[i].type == 'checkbox')
}); checkboxes[i].checked = elem.checked;
} }
}
</script> </script>
{% endblock %} {% endblock %}

15
sapl/templates/materia/em_lote/anexada.html

@ -45,7 +45,7 @@
<div class="controls"> <div class="controls">
<div class="checkbox"> <div class="checkbox">
<label for="id_check_all"> <label for="id_check_all">
<input type="checkbox" id="id_check_all" onchange="checkAll(event)" /> Marcar/Desmarcar Todos <input type="checkbox" id="id_check_all" onchange="checkAll(this)" /> Marcar/Desmarcar Todos
</label> </label>
</div> </div>
</div> </div>
@ -73,11 +73,12 @@
{% endblock detail_content %} {% endblock detail_content %}
{% block extra_js %} {% block extra_js %}
<script language="JavaScript"> <script language="JavaScript">
function checkAll(event) { function checkAll(elem) {
$('[name=materia_id]').each(function() { let checkboxes = document.getElementsByName('materia_id');
$(this).prop('checked', event.target.checked ? 'checked': null); for (let i = 0; i < checkboxes.length; i++) {
$(this).trigger('click'); if (checkboxes[i].type == 'checkbox')
}); checkboxes[i].checked = elem.checked;
} }
}
</script> </script>
{% endblock %} {% endblock %}

15
sapl/templates/materia/em_lote/tramitacao.html

@ -96,7 +96,7 @@
<div class="controls"> <div class="controls">
<div class="checkbox"> <div class="checkbox">
<label for="id_check_all"> <label for="id_check_all">
<input type="checkbox" id="id_check_all" onchange="checkAll(event)" /> Marcar/Desmarcar Todos <input type="checkbox" id="id_check_all" onchange="checkAll(this)" /> Marcar/Desmarcar Todos
</label> </label>
</div> </div>
</div> </div>
@ -127,12 +127,13 @@
{% endblock detail_content %} {% endblock detail_content %}
{% block extra_js %} {% block extra_js %}
<script language="JavaScript"> <script language="JavaScript">
function checkAll(event) { function checkAll(elem) {
$('[name=materia_id]').each(function() { let checkboxes = document.getElementsByName('materia_id');
$(this).prop('checked', event.target.checked ? 'checked': null); for (let i = 0; i < checkboxes.length; i++) {
$(this).trigger('click'); if (checkboxes[i].type == 'checkbox')
}); checkboxes[i].checked = elem.checked;
} }
}
$(document).ready(function(){ $(document).ready(function(){
var primeira_tramitacao = {{primeira_tramitacao|yesno:"true,false"}} var primeira_tramitacao = {{primeira_tramitacao|yesno:"true,false"}}

37
sapl/templates/sessao/votacao/votacao_bloco_expediente.html

@ -110,35 +110,16 @@
<script language="JavaScript"> <script language="JavaScript">
function checkAll(elem) { function checkAll(elem) {
let checkboxes = document.getElementsByName('marcadas_1'); let checkboxes = document.getElementsByName('marcadas_1');
if (elem.checked) { for (let i = 0; i < checkboxes.length; i++) {
for (let i = 0; i < checkboxes.length; i++) { if (checkboxes[i].type == 'checkbox')
if (checkboxes[i].type == 'checkbox') { checkboxes[i].checked = elem.checked;
checkboxes[i].checked = true; }
}
}
} else {
for (let i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].type == 'checkbox') {
checkboxes[i].checked = false;
}
}
}
checkboxes = document.getElementsByName('marcadas_2'); checkboxes = document.getElementsByName('marcadas_2');
if (elem.checked) { for (let i = 0; i < checkboxes.length; i++) {
for (let i = 0; i < checkboxes.length; i++) { if (checkboxes[i].type == 'checkbox')
if (checkboxes[i].type == 'checkbox') { checkboxes[i].checked = elem.checked;
checkboxes[i].checked = true; }
}
}
} else {
for (let i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].type == 'checkbox') {
checkboxes[i].checked = false;
}
}
}
} }
function alteraTipoVotacao() { function alteraTipoVotacao() {

37
sapl/templates/sessao/votacao/votacao_bloco_ordem.html

@ -110,35 +110,16 @@
<script language="JavaScript"> <script language="JavaScript">
function checkAll(elem) { function checkAll(elem) {
let checkboxes = document.getElementsByName('marcadas_1'); let checkboxes = document.getElementsByName('marcadas_1');
if (elem.checked) { for (let i = 0; i < checkboxes.length; i++) {
for (let i = 0; i < checkboxes.length; i++) { if (checkboxes[i].type == 'checkbox')
if (checkboxes[i].type == 'checkbox') { checkboxes[i].checked = elem.checked;
checkboxes[i].checked = true; }
}
}
} else {
for (let i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].type == 'checkbox') {
checkboxes[i].checked = false;
}
}
}
checkboxes = document.getElementsByName('marcadas_2'); checkboxes = document.getElementsByName('marcadas_2');
if (elem.checked) { for (let i = 0; i < checkboxes.length; i++) {
for (let i = 0; i < checkboxes.length; i++) { if (checkboxes[i].type == 'checkbox')
if (checkboxes[i].type == 'checkbox') { checkboxes[i].checked = elem.checked;
checkboxes[i].checked = true; }
}
}
} else {
for (let i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].type == 'checkbox') {
checkboxes[i].checked = false;
}
}
}
} }
function alteraTipoVotacao() { function alteraTipoVotacao() {

Loading…
Cancel
Save