Skip to content

Commit

Permalink
bug #6169 Fix the JavaScript code of the light/dark mode selector (ja…
Browse files Browse the repository at this point in the history
…viereguiluz)

This PR was merged into the 4.x branch.

Discussion
----------

Fix the JavaScript code of the light/dark mode selector

Fixes #6161

Commits
-------

d3ed892 Fix the JavaScript code of the light/dark mode selector
  • Loading branch information
javiereguiluz committed Feb 28, 2024
2 parents 16f5df1 + d3ed892 commit e794e9b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions assets/js/page-color-scheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ class ColorSchemeHandler {
}

createColorSchemeSelector() {
if (null === document.querySelector('.dropdown-settings')) {
if (null === document.querySelector('.dropdown-settings a[data-ea-color-scheme]')) {
return;
}

// for·responsive design" reasons, pages contain two settings dropdowns (and inside them, one
// for responsive design" reasons, pages contain two settings dropdowns (and inside them, one
// scheme selector each) instead of one and the selected scheme must be kept in sync in both
const colorSchemeSelectors = document.querySelectorAll('.dropdown-settings');
const currentScheme = localStorage.getItem(this.#colorSchemeLocalStorageKey) || 'auto';
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/public/entrypoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"page-color-scheme": {
"js": [
"/page-color-scheme.e0316f30.js"
"/page-color-scheme.4c28406c.js"
]
},
"field-boolean": {
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"app.js": "app.bca12d12.js",
"form.js": "form.6e84c31d.js",
"page-layout.js": "page-layout.3347892e.js",
"page-color-scheme.js": "page-color-scheme.e0316f30.js",
"page-color-scheme.js": "page-color-scheme.4c28406c.js",
"field-boolean.js": "field-boolean.38cf4737.js",
"field-code-editor.css": "field-code-editor.78ccdb00.css",
"field-code-editor.rtl.css": "field-code-editor.78ccdb00.rtl.css",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e794e9b

Please sign in to comment.