Fix incorrect _updateClipboardMonitorEnabled invocation (#1677)
This commit is contained in:
parent
8442a8ba22
commit
bc6fb4e7d7
@ -50,6 +50,8 @@ class SearchDisplayController {
|
|||||||
async prepare() {
|
async prepare() {
|
||||||
await this._display.updateOptions();
|
await this._display.updateOptions();
|
||||||
|
|
||||||
|
this._searchPersistentStateController.on('modeChange', this._onModeChange.bind(this));
|
||||||
|
|
||||||
chrome.runtime.onMessage.addListener(this._onMessage.bind(this));
|
chrome.runtime.onMessage.addListener(this._onMessage.bind(this));
|
||||||
yomichan.on('optionsUpdated', this._onOptionsUpdated.bind(this));
|
yomichan.on('optionsUpdated', this._onOptionsUpdated.bind(this));
|
||||||
|
|
||||||
@ -65,6 +67,8 @@ class SearchDisplayController {
|
|||||||
['updateSearchQuery', {async: false, handler: this._onExternalSearchUpdate.bind(this)}]
|
['updateSearchQuery', {async: false, handler: this._onExternalSearchUpdate.bind(this)}]
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
this._updateClipboardMonitorEnabled();
|
||||||
|
|
||||||
this._display.autoPlayAudioDelay = 0;
|
this._display.autoPlayAudioDelay = 0;
|
||||||
this._display.queryParserVisible = true;
|
this._display.queryParserVisible = true;
|
||||||
this._display.setHistorySettings({useBrowserHistory: true});
|
this._display.setHistorySettings({useBrowserHistory: true});
|
||||||
@ -217,6 +221,10 @@ class SearchDisplayController {
|
|||||||
this._setClipboardMonitorEnabled(enabled);
|
this._setClipboardMonitorEnabled(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_onModeChange() {
|
||||||
|
this._updateClipboardMonitorEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
_setWanakanaEnabled(enabled) {
|
_setWanakanaEnabled(enabled) {
|
||||||
if (this._queryInputEventsSetup && this._wanakanaEnabled === enabled) { return; }
|
if (this._queryInputEventsSetup && this._wanakanaEnabled === enabled) { return; }
|
||||||
|
|
||||||
|
@ -15,8 +15,9 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class SearchPersistentStateController {
|
class SearchPersistentStateController extends EventDispatcher {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
super();
|
||||||
this._mode = null;
|
this._mode = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,6 +60,6 @@ class SearchPersistentStateController {
|
|||||||
}
|
}
|
||||||
this._mode = mode;
|
this._mode = mode;
|
||||||
document.documentElement.dataset.searchMode = (mode !== null ? mode : '');
|
document.documentElement.dataset.searchMode = (mode !== null ? mode : '');
|
||||||
this._updateClipboardMonitorEnabled();
|
this.trigger('modeChange', {mode});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user