Skip to content

Commit

Permalink
Esconder e Mostrar a Tabela do modal Impressão
Browse files Browse the repository at this point in the history
Adicionada Javascript onde esconderá ou mostrará a tabela de alunos que podem ser selecionados, nos modais Imprimir Boletim e Imprimir Presença
  • Loading branch information
JoaoVitorDomingos committed Oct 20, 2024
1 parent 0f5ec98 commit 9430ae4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
4 changes: 4 additions & 0 deletions css/modais.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
max-height: 250px;
}

.esconder {
display: none;
}

/* Modal - Editar Back */
#editar_back form fieldset {
margin-bottom: 30px;
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ <h2>Imprimir Boletim</h2>
</form>

<div class="container-tabela-modal w-75 mx-auto mb-4">
<table class="table table-striped table-bordered border-dark">
<table class="table table-striped table-bordered border-dark esconder">
<thead>
<tr>
<th scope="col">Escolher</th>
Expand Down Expand Up @@ -675,7 +675,7 @@ <h2>Imprimir Presença</h2>
</form>

<div class="container-tabela-modal w-75 mx-auto mb-4">
<table class="table table-striped table-bordered border-dark">
<table class="table table-striped table-bordered border-dark esconder">
<thead>
<tr>
<th scope="col">Escolher</th>
Expand Down
27 changes: 26 additions & 1 deletion scripts/estilos.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,29 @@ modal_editarBack_formRadios.addEventListener("click", evt => {
}
})


// Mostra e esconde a tabela dos modais
const imprimirBo_table = document.querySelector("#imprimir_boletim>div>div>div>div>table")
const imprimirPre_table = document.querySelector("#imprimir_presenca>div>div>div>div>table")
const radios_imprimir = [...document.getElementsByName("imprimir_bo_tipo"), ...document.getElementsByName("imprimir_pre_tipo")]

radios_imprimir.forEach(el => {
el.addEventListener("click", evento => {
console.log(evento.target)
console.log(evento.target.name)
if(evento.target.name == "imprimir_bo_tipo") {
console.log(evento.target.id)
if(evento.target.id == "imprimir_bo_sala" && evento.target.checked) {
imprimirBo_table.classList.add("esconder")
} else if(evento.target.id == "imprimir_bo_escolher" && evento.target.checked) {
imprimirBo_table.classList.remove("esconder")
}
} else if(evento.target.name == "imprimir_pre_tipo") {
console.log(evento.target.id)
if(evento.target.id == "imprimir_pre_sala" && evento.target.checked) {
imprimirPre_table.classList.add("esconder")
} else if(evento.target.id == "imprimir_pre_escolher" && evento.target.checked) {
imprimirPre_table.classList.remove("esconder")
}
}
})
})

0 comments on commit 9430ae4

Please sign in to comment.