Skip to content
Snippets Groups Projects
Commit 60fb9f23 authored by jurgenhaas's avatar jurgenhaas
Browse files

Go back to gin_toolbar RC and add a Gin patch

parent 430c5811
No related branches found
No related tags found
1 merge request!363Merging develop into main
Pipeline #1363911 passed
......@@ -118,6 +118,9 @@
"#3392567 Fix href": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3392567.diff",
"#3084395 Daterange basefield": "https://www.drupal.org/files/issues/2022-03-25/3084395-11.patch"
},
"drupal/gin": {
"#3475773 JS error": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3475773.diff"
},
"drupal/gin_toolbar": {
"#3319445 Permission check": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3319445.diff"
},
......
......@@ -118,6 +118,9 @@
"#3392567 Fix href": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3392567.diff",
"#3084395 Daterange basefield": "https://www.drupal.org/files/issues/2022-03-25/3084395-11.patch"
},
"drupal/gin": {
"#3475773 JS error": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3475773.diff"
},
"drupal/gin_toolbar": {
"#3319445 Permission check": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3319445.diff"
},
......
diff --git a/dist/js/init.js b/dist/js/init.js
index 3a8a290b384132d12ca9b2720322e6ec817516bf..5a88ff2ea090f7f470e29908f37a6ff074940710 100644
--- a/dist/js/init.js
+++ b/dist/js/init.js
@@ -2,9 +2,11 @@
if (localStorage.getItem("GinDarkMode") && localStorage.removeItem("GinDarkMode"),
localStorage.getItem("Drupal.gin.darkmode") && localStorage.removeItem("Drupal.gin.darkmode"),
localStorage.getItem("GinSidebarOpen") && (localStorage.setItem("Drupal.gin.toolbarExpanded", localStorage.getItem("GinSidebarOpen")),
- localStorage.removeItem("GinSidebarOpen")), window.ginDarkmode = JSON.parse(document.getElementById("gin-setting-darkmode").textContent).ginDarkmode,
- 1 == window.ginDarkmode || "auto" === window.ginDarkmode && window.matchMedia("(prefers-color-scheme: dark)").matches ? document.documentElement.classList.add("gin--dark-mode") : !0 === document.documentElement.classList.contains("gin--dark-mode") && document.documentElement.classList.remove("gin--dark-mode"),
- localStorage.getItem("Drupal.gin.toolbarExpanded")) {
+ localStorage.removeItem("GinSidebarOpen")), function() {
+ const darkmodeSetting = document.getElementById("gin-setting-darkmode")?.textContent;
+ window.ginDarkmode = darkmodeSetting ? JSON.parse(darkmodeSetting)?.ginDarkmode : "auto",
+ 1 == window.ginDarkmode || "auto" === window.ginDarkmode && window.matchMedia("(prefers-color-scheme: dark)").matches ? document.documentElement.classList.add("gin--dark-mode") : !0 === document.documentElement.classList.contains("gin--dark-mode") && document.documentElement.classList.remove("gin--dark-mode");
+ }(), localStorage.getItem("Drupal.gin.toolbarExpanded")) {
const style = document.createElement("style"), className = "gin-toolbar-inline-styles";
if (style.className = className, "true" === localStorage.getItem("Drupal.gin.toolbarExpanded")) {
style.innerHTML = "\n @media (min-width: 976px) {\n /* Small CSS hack to make sure this has the highest priority */\n body.gin--vertical-toolbar.gin--vertical-toolbar.gin--vertical-toolbar {\n padding-inline-start: 256px !important;\n transition: none !important;\n }\n\n .gin--vertical-toolbar .toolbar-menu-administration {\n min-width: var(--gin-toolbar-width, 256px);\n transition: none;\n }\n\n .gin--vertical-toolbar .toolbar-menu-administration > .toolbar-menu > .menu-item > .toolbar-icon,\n .gin--vertical-toolbar .toolbar-menu-administration > .toolbar-menu > .menu-item > .toolbar-box > .toolbar-icon {\n min-width: calc(var(--gin-toolbar-width, 256px) - 16px);\n }\n }\n ";
diff --git a/js/init.js b/js/init.js
index b5167343640982546d23c5926a90e00e41cd0e45..560eafea4ee26f8146bf9d80784cff55ba0b0209 100644
--- a/js/init.js
+++ b/js/init.js
@@ -22,7 +22,9 @@ checkLegacy();
function ginInitDarkmode() {
const darkModeClass = 'gin--dark-mode';
- window.ginDarkmode = JSON.parse(document.getElementById('gin-setting-darkmode').textContent).ginDarkmode;
+ const darkmodeSetting = document.getElementById('gin-setting-darkmode')?.textContent;
+ // Set window variable.
+ window.ginDarkmode = darkmodeSetting ? JSON.parse(darkmodeSetting)?.ginDarkmode : 'auto';
if (
window.ginDarkmode == 1 ||
......@@ -115,6 +115,9 @@
"#3392567 Fix href": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3392567.diff",
"#3084395 Daterange basefield": "https://www.drupal.org/files/issues/2022-03-25/3084395-11.patch"
},
"drupal/gin": {
"#3475773 JS error": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3475773.diff"
},
"drupal/gin_toolbar": {
"#3319445 Permission check": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3319445.diff"
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment