From 97be029deee4ec34ad2e90081af15d573dede0cd Mon Sep 17 00:00:00 2001 From: siikamiika Date: Sat, 31 Aug 2019 18:01:38 +0300 Subject: [PATCH] focus the site when closing multi-level popups --- ext/fg/js/popup.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js index c91764c4..61a5e4d0 100644 --- a/ext/fg/js/popup.js +++ b/ext/fg/js/popup.js @@ -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(); } }