aboutsummaryrefslogtreecommitdiff
path: root/ext/js/display
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/display')
-rw-r--r--ext/js/display/display.js12
-rw-r--r--ext/js/display/search-main.js2
2 files changed, 12 insertions, 2 deletions
diff --git a/ext/js/display/display.js b/ext/js/display/display.js
index 386f456b..33ab44e4 100644
--- a/ext/js/display/display.js
+++ b/ext/js/display/display.js
@@ -1152,16 +1152,24 @@ export class Display extends EventDispatcher {
_setTheme(options) {
const {general} = options;
const {popupTheme} = general;
+ /** @type {string} */
+ let pageType = this._pageType;
try {
// eslint-disable-next-line no-underscore-dangle
- const pageTheme = this._history._current.state?.pageTheme;
+ const historyState = this._history._current.state;
+
+ const pageTheme = historyState?.pageTheme;
this._themeController.siteTheme = pageTheme ?? null;
+
+ if (historyState?.url?.includes('popup-preview.html')) {
+ pageType = 'popupPreview';
+ }
} catch (e) {
log.error(e);
}
this._themeController.theme = popupTheme;
this._themeController.outerTheme = general.popupOuterTheme;
- this._themeController.siteOverride = this._pageType === 'search';
+ this._themeController.siteOverride = pageType === 'search' || pageType === 'popupPreview';
this._themeController.updateTheme();
this.setCustomCss(general.customPopupCss);
}
diff --git a/ext/js/display/search-main.js b/ext/js/display/search-main.js
index c3c292a1..d3ef2539 100644
--- a/ext/js/display/search-main.js
+++ b/ext/js/display/search-main.js
@@ -51,6 +51,8 @@ await Application.main(true, async (application) => {
const searchDisplayController = new SearchDisplayController(display, displayAudio, searchPersistentStateController);
await searchDisplayController.prepare();
+ document.body.hidden = false;
+
display.initializeState();
document.documentElement.dataset.loaded = 'true';