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

Fix : disabled button when no area selected

parent 09cebfdc
No related branches found
No related tags found
1 merge request!86Resolve "Search Field"
...@@ -80,6 +80,7 @@ class CandidateList { ...@@ -80,6 +80,7 @@ class CandidateList {
id="candidate-list-clone" id="candidate-list-clone"
class="button large-button is-primary" class="button large-button is-primary"
title="Importer une liste" title="Importer une liste"
disabled
> >
<span class="icon is-small"> <span class="icon is-small">
<i class="fas fa-download"></i> <i class="fas fa-download"></i>
...@@ -89,6 +90,7 @@ class CandidateList { ...@@ -89,6 +90,7 @@ class CandidateList {
id="candidate-list-new" id="candidate-list-new"
class="button large-button is-success" class="button large-button is-success"
title="Ajouter une liste" title="Ajouter une liste"
disabled
> >
<span class="icon is-small"> <span class="icon is-small">
<i class="fas fa-plus"></i> <i class="fas fa-plus"></i>
...@@ -427,6 +429,17 @@ class CandidateList { ...@@ -427,6 +429,17 @@ class CandidateList {
handleDom() { handleDom() {
let candidateListHandler = this; let candidateListHandler = this;
document
.getElementById(`candidate-list-new`)
.addEventListener("click", function () {
candidateListHandler.newCandidateList();
});
document
.getElementById(`candidate-list-clone`)
.addEventListener("click", function () {
candidateListHandler.cloneCandidateListModal();
});
document document
.getElementById(`candidateList-modal-close`) .getElementById(`candidateList-modal-close`)
.addEventListener("click", function () { .addEventListener("click", function () {
...@@ -563,18 +576,8 @@ class CandidateList { ...@@ -563,18 +576,8 @@ class CandidateList {
await candidateListHandler.displayCandidates(); await candidateListHandler.displayCandidates();
}); });
}); });
document.getElementById(`candidate-list-new`).removeAttribute("disabled");
document document.getElementById(`candidate-list-clone`).removeAttribute("disabled");
.getElementById(`candidate-list-new`)
.addEventListener("click", function () {
candidateListHandler.newCandidateList();
});
document
.getElementById(`candidate-list-clone`)
.addEventListener("click", function () {
candidateListHandler.cloneCandidateListModal();
});
} }
async updateCandidateLists() { async updateCandidateLists() {
...@@ -773,6 +776,12 @@ class CandidateList { ...@@ -773,6 +776,12 @@ class CandidateList {
this.area = null; this.area = null;
document.getElementById("candidate-lists-list").innerHTML = ""; document.getElementById("candidate-lists-list").innerHTML = "";
this.emptyCandidate(); this.emptyCandidate();
document
.getElementById(`candidate-list-new`)
.setAttribute("disabled", "true");
document
.getElementById(`candidate-list-clone`)
.setAttribute("disabled", "true");
} }
emptyCandidate() { emptyCandidate() {
......
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