summaryrefslogtreecommitdiff
path: root/ext/fg/js/popup.js
diff options
context:
space:
mode:
authorAlex Yatskov <FooSoft@users.noreply.github.com>2019-09-30 19:53:45 -0700
committerGitHub <noreply@github.com>2019-09-30 19:53:45 -0700
commit00d16433e705b916d4e078244b213cede8bff5bb (patch)
treef9e7c3fc6dea6f761288a53bf31cc06fe6567978 /ext/fg/js/popup.js
parenteadd03624c6630ce83ba89dc26d52a94c5c23a75 (diff)
parent25a4dafd73890a8181bd072d0b514ec9668ecfea (diff)
Merge pull request #228 from toasted-nutbread/fix-tab-focus-changing
Fix tab focus being changed due to settings changes
Diffstat (limited to 'ext/fg/js/popup.js')
-rw-r--r--ext/fg/js/popup.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index 08965084..64da9aef 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -105,7 +105,7 @@ class Popup {
container.style.height = `${height}px`;
container.style.visibility = 'visible';
- this.hideChildren();
+ this.hideChildren(true);
}
static getPositionForHorizontalText(elementRect, width, height, maxWidth, maxHeight, optionsGeneral) {
@@ -206,16 +206,21 @@ class Popup {
this.invokeApi('orphaned');
}
- hide() {
- this.hideChildren();
+ hide(changeFocus) {
+ if (this.isContainerHidden()) {
+ changeFocus = false;
+ }
+ this.hideChildren(changeFocus);
this.hideContainer();
- this.focusParent();
+ if (changeFocus) {
+ this.focusParent();
+ }
}
- hideChildren() {
- // recursively hides all children
- if (this.child && !this.child.isContainerHidden()) {
- this.child.hide();
+ hideChildren(changeFocus) {
+ // Recursively hides all children.
+ if (this.child !== null && !this.child.isContainerHidden()) {
+ this.child.hide(changeFocus);
}
}