8000 fix: Changing color scheme resets session settings to defaults (#7407) · django-cms/django-cms@fcfe77f · GitHub
[go: up one dir, main page]

Skip to content

Commit fcfe77f

Browse files
authored
fix: Changing color scheme resets session settings to defaults (#7407)
* Fix: incorrect saveing of color scheme in CMS.settings * Add: changelog entry :-)
1 parent e59c179 commit fcfe77f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ unreleased
99
* Add support for tel: and mailto: URIs in Advanced Page Settings redirect field.
1010
* Make javascript dark mode functions available to popups as CMS.API.getColorScheme
1111
and CMS.API.setColorScheme
12+
* Fix bug where switching color scheme affects other settings
1213
* Unlocalize page and node ids when rendering the page tree in the admin (#7175)
1314
* Fixed permission denied error after page create (#6866)
1415

cms/static/cms/js/modules/cms.base.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,12 @@ export const Helpers = {
510510
setColorScheme: function (scheme) {
511511
let body = $('html');
512512

513-
this.setSettings({ color_scheme: scheme });
513+
if (!CMS.settings) {
514+
// Settings loaded? If not, pls. load.
515+
this.getSettings();
516+
}
517+
CMS.settings.color_scheme = scheme;
518+
this.setSettings(CMS.settings);
514519
if (scheme === 'auto') {
515520
body.removeAttr('data-color-scheme');
516521
body.find('div.cms iframe').each(function(i, e) {

0 commit comments

Comments
 (0)
0