diff options
author | Kuuuube <61125188+Kuuuube@users.noreply.github.com> | 2024-06-18 20:18:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-19 00:18:43 +0000 |
commit | 451bcab01fd591ec54b63af0fc7084dc9f37928b (patch) | |
tree | 5b7ae78d7187c77f4b12bf377524e837e9b24606 /ext/js/app/frontend.js | |
parent | c002e585fcbfc89b2c345a10c0663336f31442af (diff) |
Add auto option to body theme (#1086)
* Add auto option to body theme
* Fix firefox bug where themes do not set correctly in settings due to getOptions failing
Diffstat (limited to 'ext/js/app/frontend.js')
-rw-r--r-- | ext/js/app/frontend.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/js/app/frontend.js b/ext/js/app/frontend.js index 71b8d6ef..8ac27979 100644 --- a/ext/js/app/frontend.js +++ b/ext/js/app/frontend.js @@ -387,14 +387,14 @@ export class Frontend { /** * @param {import('text-scanner').EventArgument<'searchSuccess'>} details */ - _onSearchSuccess({type, dictionaryEntries, sentence, inputInfo: {eventType, detail: inputInfoDetail}, textSource, optionsContext, detail}) { + _onSearchSuccess({type, dictionaryEntries, sentence, inputInfo: {eventType, detail: inputInfoDetail}, textSource, optionsContext, detail, pageTheme}) { this._stopClearSelectionDelayed(); let focus = (eventType === 'mouseMove'); if (typeof inputInfoDetail === 'object' && inputInfoDetail !== null) { const focus2 = inputInfoDetail.focus; if (typeof focus2 === 'boolean') { focus = focus2; } } - this._showContent(textSource, focus, dictionaryEntries, type, sentence, detail !== null ? detail.documentTitle : null, optionsContext); + this._showContent(textSource, focus, dictionaryEntries, type, sentence, detail !== null ? detail.documentTitle : null, optionsContext, pageTheme); } /** */ @@ -716,8 +716,9 @@ export class Frontend { * @param {?import('display').HistoryStateSentence} sentence * @param {?string} documentTitle * @param {import('settings').OptionsContext} optionsContext + * @param {'dark' | 'light'} pageTheme */ - _showContent(textSource, focus, dictionaryEntries, type, sentence, documentTitle, optionsContext) { + _showContent(textSource, focus, dictionaryEntries, type, sentence, documentTitle, optionsContext, pageTheme) { const query = textSource.text(); const {url} = optionsContext; /** @type {import('display').HistoryState} */ @@ -725,6 +726,7 @@ export class Frontend { focusEntry: 0, optionsContext, url, + pageTheme, }; if (sentence !== null) { detailsState.sentence = sentence; } if (documentTitle !== null) { detailsState.documentTitle = documentTitle; } |