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