Added close on background click for dates and export popup
This commit is contained in:
@ -51,10 +51,18 @@ class DatesPopup extends HTMLElement{
|
|||||||
|
|
||||||
hide(){
|
hide(){
|
||||||
this.style.visibility = "hidden";
|
this.style.visibility = "hidden";
|
||||||
|
window.removeEventListener("click", this.backgroundClickCallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
backgroundClickCallback = ({target}) => {
|
||||||
|
if(target.id == "dates-popup"){
|
||||||
|
this.hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
show(){
|
show(){
|
||||||
this.setMaxInputDate();
|
this.setMaxInputDate();
|
||||||
|
window.addEventListener("click", this.backgroundClickCallback);
|
||||||
this.style.visibility = "visible";
|
this.style.visibility = "visible";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,11 +131,19 @@ class ExportPopup extends HTMLElement{
|
|||||||
|
|
||||||
hide(){
|
hide(){
|
||||||
this.style.visibility = "hidden";
|
this.style.visibility = "hidden";
|
||||||
|
window.removeEventListener("click", this.backgroundClickCallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
backgroundClickCallback = ({target}) => {
|
||||||
|
if(target.id == "export-popup"){
|
||||||
|
this.hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
show(variables, startTime, endTime){
|
show(variables, startTime, endTime){
|
||||||
this.style.visibility = "visible";
|
this.style.visibility = "visible";
|
||||||
this.updateValuesOnOpen(variables, startTime, endTime);
|
this.updateValuesOnOpen(variables, startTime, endTime);
|
||||||
|
window.addEventListener("click", this.backgroundClickCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
connectedCallback(){
|
connectedCallback(){
|
||||||
|
Reference in New Issue
Block a user