Skip to content
Snippets Groups Projects
Commit 51c40bb0 authored by Alexis POYEN's avatar Alexis POYEN
Browse files

Merge branch '52-dropdown-for-round-management' into 'master'

Feat : add dropdown for round management

Closes #52

See merge request apoyen/elections!63
parents c2e44a68 48629713
No related branches found
No related tags found
1 merge request!63Feat : add dropdown for round management
Pipeline #6296 passed
......@@ -37,13 +37,18 @@ class CandidateList {
<p id="candidate-list-title" class="card-header-title">
Liste des candidats par circonscription
</p>
<button id="dropdown-candidate-lists" class="button">
<span class="icon is-small">
<i class="fas fa-caret-down"></i>
</span>
</button>
<button id="candidate-list-new" class="button is-success" disabled>
<span class="icon is-small">
<i class="fas fa-plus"></i>
</span>
</button>
</header>
<div class="columns card-content">
<div id="candidate-lists-dropdown-content" class="columns card-content">
<div class="column">
<div id="areas-round"></div>
</div>
......@@ -562,10 +567,9 @@ class CandidateList {
this.area = null;
document.getElementById("candidate-lists-list").innerHTML = "";
this.emptyCandidate();
}
emptyCandidate(){
emptyCandidate() {
this.candidateList = null;
document.getElementById("candidate-list").innerHTML = "";
}
......
......@@ -34,8 +34,13 @@ class RoundDesk {
<p id="desk-round-title" class="card-header-title">
Bureaux de votes
</p>
<button id="dropdown-round-desks" class="button">
<span class="icon is-small">
<i class="fas fa-caret-down"></i>
</span>
</button>
</header>
<div class="columns card-content">
<div id="desk-rounds-dropdown-content" class="columns card-content">
<div class="column">
<div id="desk-rounds"></div>
</div>
......
......@@ -37,8 +37,41 @@ class Round {
<div class="modal" id="capturers-modal"></div>
<div class="modal" id="candidateList-modal"></div>
`;
this.roundsHandler = await RoundsCard.mount("rounds-list", this)
this.deskRoundsHandler = await RoundDesks.mount("round-desks", this)
this.candidateListHandler = await CandidateList.mount("candidate-lists", this)
this.roundsHandler = await RoundsCard.mount("rounds-list", this);
this.deskRoundsHandler = await RoundDesks.mount("round-desks", this);
this.candidateListHandler = await CandidateList.mount(
"candidate-lists",
this
);
document.getElementById("candidate-lists-dropdown-content").style.display =
"none";
document.getElementById("candidate-lists").style.height = "auto";
this.handleDOM();
}
handleDOM() {
let dropdownRoundDesks = document.getElementById("dropdown-round-desks");
let dropdownCandidateList = document.getElementById(
"dropdown-candidate-lists"
);
dropdownRoundDesks.addEventListener("click", function () {
document.getElementById("desk-rounds-dropdown-content").style.display =
"flex";
document.getElementById("round-desks").style.height = "70vh";
document.getElementById(
"candidate-lists-dropdown-content"
).style.display = "none";
document.getElementById("candidate-lists").style.height = "auto";
});
dropdownCandidateList.addEventListener("click", function () {
document.getElementById("desk-rounds-dropdown-content").style.display =
"none";
document.getElementById("round-desks").style.height = "auto";
document.getElementById(
"candidate-lists-dropdown-content"
).style.display = "flex";
document.getElementById("candidate-lists").style.height = "70vh";
});
}
}
......@@ -116,7 +116,7 @@ select {
#round-desks,
#candidate-lists {
height: 35vh;
height: 70vh;
}
#round-desks .column,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment