aboutsummaryrefslogtreecommitdiff
path: root/ext/js/language
diff options
context:
space:
mode:
authorKuuuube <61125188+Kuuuube@users.noreply.github.com>2024-06-18 20:18:43 -0400
committerGitHub <noreply@github.com>2024-06-19 00:18:43 +0000
commit451bcab01fd591ec54b63af0fc7084dc9f37928b (patch)
tree5b7ae78d7187c77f4b12bf377524e837e9b24606 /ext/js/language
parentc002e585fcbfc89b2c345a10c0663336f31442af (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/language')
-rw-r--r--ext/js/language/text-scanner.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/js/language/text-scanner.js b/ext/js/language/text-scanner.js
index fdc33400..249a2eda 100644
--- a/ext/js/language/text-scanner.js
+++ b/ext/js/language/text-scanner.js
@@ -16,6 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+import {ThemeController} from '../app/theme-controller.js';
import {EventDispatcher} from '../core/event-dispatcher.js';
import {EventListenerCollection} from '../core/event-listener-collection.js';
import {log} from '../core/log.js';
@@ -478,6 +479,11 @@ export class TextScanner extends EventDispatcher {
this.setCurrentTextSource(textSource);
this._selectionRestoreInfo = selectionRestoreInfo;
+ /** @type {ThemeController} */
+ this._themeController = new ThemeController(document.documentElement);
+ this._themeController.prepare();
+ const pageTheme = this._themeController.computeSiteTheme();
+
this.trigger('searchSuccess', {
type,
dictionaryEntries,
@@ -486,6 +492,7 @@ export class TextScanner extends EventDispatcher {
textSource,
optionsContext,
detail,
+ pageTheme,
});
} else {
this._triggerSearchEmpty(inputInfo);