mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +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) {
|
||||
if (color_scheme !== 'dark') {
|
||||
color_scheme = 'light';
|
||||
if (color_scheme === 'dark' || 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