focus the site when closing multi-level popups

This commit is contained in:
siikamiika 2019-08-31 18:01:38 +03:00 committed by toasted-nutbread
parent 834f14e808
commit 97be029dee

View File

@ -206,9 +206,9 @@ class Popup {
}
hide() {
this.hideChildren();
this.hideContainer();
this.focusParent();
this.hideChildren();
}
hideChildren() {
@ -221,7 +221,7 @@ class Popup {
const target = targets.shift();
if (target.isContainerHidden()) { continue; }
target.hideContainer();
target.hide();
for (const child of target.children) {
targets.push(child);
}
@ -249,10 +249,9 @@ class Popup {
}
focusParent() {
this.container.blur();
if (this.parent && this.parent.container) {
this.parent.container.focus();
} else {
this.container.blur();
}
}