Fix auto-play not working on the search page (#1882)
This commit is contained in:
parent
69e448a955
commit
916189f402
@ -77,7 +77,7 @@ class DisplayAudio {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setupEntriesComplete() {
|
setupEntriesComplete() {
|
||||||
if (!this._autoPlay || !this._display.popupVisible) { return; }
|
if (!this._autoPlay || !this._display.frameVisible) { return; }
|
||||||
|
|
||||||
this.clearAutoPlayTimer();
|
this.clearAutoPlayTimer();
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ class Display extends EventDispatcher {
|
|||||||
this._optionToggleHotkeyHandler = new OptionToggleHotkeyHandler(this);
|
this._optionToggleHotkeyHandler = new OptionToggleHotkeyHandler(this);
|
||||||
this._elementOverflowController = new ElementOverflowController();
|
this._elementOverflowController = new ElementOverflowController();
|
||||||
this._displayAnki = new DisplayAnki(this, japaneseUtil);
|
this._displayAnki = new DisplayAnki(this, japaneseUtil);
|
||||||
this._popupVisible = false;
|
this._frameVisible = (pageType === 'search');
|
||||||
|
|
||||||
this._hotkeyHandler.registerActions([
|
this._hotkeyHandler.registerActions([
|
||||||
['close', () => { this._onHotkeyClose(); }],
|
['close', () => { this._onHotkeyClose(); }],
|
||||||
@ -210,8 +210,8 @@ class Display extends EventDispatcher {
|
|||||||
return this._fullQuery;
|
return this._fullQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
get popupVisible() {
|
get frameVisible() {
|
||||||
return this._popupVisible;
|
return this._frameVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
async prepare() {
|
async prepare() {
|
||||||
@ -527,7 +527,7 @@ class Display extends EventDispatcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_onMessageVisibilityChanged({value}) {
|
_onMessageVisibilityChanged({value}) {
|
||||||
this._popupVisible = value;
|
this._frameVisible = value;
|
||||||
if (!value) {
|
if (!value) {
|
||||||
this._displayAudio.clearAutoPlayTimer();
|
this._displayAudio.clearAutoPlayTimer();
|
||||||
this._displayAudio.stopAudio();
|
this._displayAudio.stopAudio();
|
||||||
|
Loading…
Reference in New Issue
Block a user