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/2601/head
Cesar Augusto de Carvalho 6 years ago
committed by Edward Ribeiro
parent
commit
b73f79f299
  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="checkbox">
<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>
</div>
</div>
@ -109,11 +109,12 @@
{% endblock detail_content %}
{% block extra_js %}
<script language="JavaScript">
function checkAll(event) {
$('[name=materia_id]').each(function() {
$(this).prop('checked', event.target.checked ? 'checked': null);
$(this).trigger('click');
});
}
function checkAll(elem) {
let checkboxes = document.getElementsByName('materia_id');
for (let i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].type == 'checkbox')
checkboxes[i].checked = elem.checked;
}
}
</script>
{% endblock %}

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

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

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

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

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

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

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

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

Loading…
Cancel
Save