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