diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-08-10 19:23:05 -0400 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-08-12 20:49:39 -0400 |
commit | c99cf4fe42761df941dc6b047159dd06ae67a943 (patch) | |
tree | 99958770d0d92e90ba75c2d41d380fdb29bff3f6 /ext/js | |
parent | d0bcc1ed39591e735204fc58ae0ce1ebe03b6a8d (diff) |
Fix auto-play not working on the search page (#1882)
Diffstat (limited to 'ext/js')
-rw-r--r-- | ext/js/display/display-audio.js | 2 | ||||
-rw-r--r-- | ext/js/display/display.js | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/ext/js/display/display-audio.js b/ext/js/display/display-audio.js index 972d90b6..3a6b7a50 100644 --- a/ext/js/display/display-audio.js +++ b/ext/js/display/display-audio.js @@ -77,7 +77,7 @@ class DisplayAudio { } setupEntriesComplete() { - if (!this._autoPlay || !this._display.popupVisible) { return; } + if (!this._autoPlay || !this._display.frameVisible) { return; } this.clearAutoPlayTimer(); diff --git a/ext/js/display/display.js b/ext/js/display/display.js index a9581def..f3d46054 100644 --- a/ext/js/display/display.js +++ b/ext/js/display/display.js @@ -111,7 +111,7 @@ class Display extends EventDispatcher { this._optionToggleHotkeyHandler = new OptionToggleHotkeyHandler(this); this._elementOverflowController = new ElementOverflowController(); this._displayAnki = new DisplayAnki(this, japaneseUtil); - this._popupVisible = false; + this._frameVisible = (pageType === 'search'); this._hotkeyHandler.registerActions([ ['close', () => { this._onHotkeyClose(); }], @@ -210,8 +210,8 @@ class Display extends EventDispatcher { return this._fullQuery; } - get popupVisible() { - return this._popupVisible; + get frameVisible() { + return this._frameVisible; } async prepare() { @@ -527,7 +527,7 @@ class Display extends EventDispatcher { } _onMessageVisibilityChanged({value}) { - this._popupVisible = value; + this._frameVisible = value; if (!value) { this._displayAudio.clearAutoPlayTimer(); this._displayAudio.stopAudio(); |