нашёл решение
// globals
if (typeof bbs == 'undefined') {
bbs = {};
}
// for switching color themes
bbs.theme = localStorage.getItem('rmz_bbs-auto-theme') || 'default';
bbs.themeLink = $('#theme-css-link');
if (bbs.themeLink.data('theme') !== bbs.theme){
bbs.themeLink.attr({
'href': 'static/css/theme_' + bbs.theme + '.css',
'data-theme': bbs.theme
});
$('body').attr('data-theme', bbs.theme);
}
$(document).ready(function(){
var themeInputs = $('.theme-input');
themeInputs.prop('checked', false);
themeInputs.filter('[value='+bbs.theme+']').prop('checked', true);
$('body').attr('data-theme', bbs.theme);
// color-theme switch
themeInputs.on('change', function(){
console.log('111');
var newTheme = $(this).val();
if (bbs.theme !== newTheme){
bbs.theme = newTheme;
bbs.themeLink.attr({
'href': 'static/css/theme_' + bbs.theme + '.css',
'data-theme': bbs.theme
});
$('body').attr('data-theme', bbs.theme);
localStorage.setItem('rmz_bbs-auto-theme', bbs.theme);
} else return;
});
})