From f1551da16138471649aa3985cf0ad793ea70d980 Mon Sep 17 00:00:00 2001 From: guimillet Date: Sat, 5 Aug 2023 15:30:36 +0200 Subject: [PATCH 1/3] Update Themes.js reintroduced changes of the previous commit, which was discarded upon updating the branch to master due to merging conlicts --- js/src/Themes.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/js/src/Themes.js b/js/src/Themes.js index 9ddf43aa..ac0ecc36 100644 --- a/js/src/Themes.js +++ b/js/src/Themes.js @@ -13,6 +13,7 @@ export class ThemeModel extends WidgetModel { _view_module_version: "0.1.11", _model_module_version: "0.1.11", dark: null, + dark_jlab: null, }, }; } @@ -29,6 +30,8 @@ export class ThemeModel extends WidgetModel { if (this.get("dark") === null) { vuetify.framework.theme.dark = document.body.dataset.jpThemeLight === "false"; + this.set('dark_jlab', vuetify.framework.theme.dark); + this.save_changes(); } }, this); } @@ -38,6 +41,15 @@ export class ThemeModel extends WidgetModel { } else if (document.body.dataset.jpThemeLight) { vuetify.framework.theme.dark = document.body.dataset.jpThemeLight === "false"; + this.set('dark_jlab', vuetify.framework.theme.dark); + this.save_changes(); + } else if (document.body.classList.contains('theme-dark')) { + vuetify.framework.theme.dark = true; + this.set('dark', true); + this.save_changes(); + } else if (document.body.classList.contains('theme-light')) { + this.set('dark', false); + this.save_changes(); } this.on("change:dark", () => { vuetify.framework.theme.dark = this.get("dark"); From 3a0f7c8e0b6702b1e3418d182777fdd115095b62 Mon Sep 17 00:00:00 2001 From: guimillet Date: Sat, 5 Aug 2023 15:39:14 +0200 Subject: [PATCH 2/3] Update Themes.py reintroduced changes of the previous commit (6 Dec 2021), which was discarded upon updating the branch to master due to merging conflicts --- ipyvuetify/Themes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ipyvuetify/Themes.py b/ipyvuetify/Themes.py index 7091f9da..e2b3e88a 100644 --- a/ipyvuetify/Themes.py +++ b/ipyvuetify/Themes.py @@ -40,6 +40,8 @@ class Theme(Widget): dark = Bool(None, allow_none=True).tag(sync=True) + dark_jlab = Bool(None, allow_none=True).tag(sync=True) + def __init__(self): super().__init__() From c5ca5fa208304a73477889ea58f9dc224da97dd9 Mon Sep 17 00:00:00 2001 From: guimillet Date: Sat, 5 Aug 2023 15:48:57 +0200 Subject: [PATCH 3/3] Update Themes.js double-quote format --- js/src/Themes.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/src/Themes.js b/js/src/Themes.js index ac0ecc36..955b3222 100644 --- a/js/src/Themes.js +++ b/js/src/Themes.js @@ -30,7 +30,7 @@ export class ThemeModel extends WidgetModel { if (this.get("dark") === null) { vuetify.framework.theme.dark = document.body.dataset.jpThemeLight === "false"; - this.set('dark_jlab', vuetify.framework.theme.dark); + this.set("dark_jlab", vuetify.framework.theme.dark); this.save_changes(); } }, this); @@ -41,14 +41,14 @@ export class ThemeModel extends WidgetModel { } else if (document.body.dataset.jpThemeLight) { vuetify.framework.theme.dark = document.body.dataset.jpThemeLight === "false"; - this.set('dark_jlab', vuetify.framework.theme.dark); + this.set("dark_jlab", vuetify.framework.theme.dark); this.save_changes(); - } else if (document.body.classList.contains('theme-dark')) { + } else if (document.body.classList.contains("theme-dark")) { vuetify.framework.theme.dark = true; - this.set('dark', true); + this.set("dark", true); this.save_changes(); - } else if (document.body.classList.contains('theme-light')) { - this.set('dark', false); + } else if (document.body.classList.contains("theme-light")) { + this.set("dark", false); this.save_changes(); } this.on("change:dark", () => {