mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-10 12:32:14 +09:00
Unset rx_color_scheme cookie if an invalid value is set (JS equivalent)
This commit is contained in:
parent
237f3b295d
commit
64c9c5ba90
1 changed files with 5 additions and 4 deletions
|
|
@ -783,11 +783,12 @@ function getColorScheme() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function setColorScheme(color_scheme) {
|
function setColorScheme(color_scheme) {
|
||||||
if (color_scheme !== 'dark') {
|
if (color_scheme === 'dark' || color_scheme === 'light') {
|
||||||
color_scheme = 'light';
|
$('body').addClass('color_scheme_' + color_scheme).removeClass('color_scheme_' + (color_scheme === 'dark' ? 'light' : 'dark'));
|
||||||
|
XE.cookie.set('rx_color_scheme', color_scheme, { path: window.XE.URI(default_url).pathname(), expires: 365 });
|
||||||
|
} else {
|
||||||
|
XE.cookie.remove('rx_color_scheme', { path: window.XE.URI(default_url).pathname() });
|
||||||
}
|
}
|
||||||
$('body').addClass('color_scheme_' + color_scheme).removeClass('color_scheme_' + (color_scheme === 'dark' ? 'light' : 'dark'));
|
|
||||||
XE.cookie.set('rx_color_scheme', color_scheme, { path: window.XE.URI(default_url).pathname(), expires: 365 });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 미리보기 */
|
/* 미리보기 */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue