summaryrefslogtreecommitdiff
path: root/ext/js/app
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-08-02 19:25:10 -0400
committerGitHub <noreply@github.com>2021-08-02 19:25:10 -0400
commitedb0aaf6b4fbaed298f81778ced68990ab4f5b9a (patch)
tree977cd3e1f74f99014b274fb7009fd1aab8fadd77 /ext/js/app
parentb0df8045f6b749208a1e34fc43a46828a490d604 (diff)
Improve audio auto play cancellation (#1873)
* Cancel automatic audio playback when hiding the popup * Don't play audio if the popup is hidden
Diffstat (limited to 'ext/js/app')
-rw-r--r--ext/js/app/popup.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/js/app/popup.js b/ext/js/app/popup.js
index 63657dd3..8bf1d7c9 100644
--- a/ext/js/app/popup.js
+++ b/ext/js/app/popup.js
@@ -38,6 +38,7 @@ class Popup extends EventDispatcher {
this._injectPromise = null;
this._injectPromiseComplete = false;
this._visible = new DynamicProperty(false);
+ this._visibleValue = false;
this._options = null;
this._optionsContext = null;
this._contentScale = 1.0;
@@ -441,7 +442,10 @@ class Popup extends EventDispatcher {
}
_onVisibleChange({value}) {
+ if (this._visibleValue === value) { return; }
+ this._visibleValue = value;
this._frame.style.setProperty('visibility', value ? 'visible' : 'hidden', 'important');
+ this._invokeSafe('visibilityChanged', {value});
}
_focusParent() {