]>
iEval git - plack-app-gruntmaster.git/blob - js/90-themes.js
1 function set_style(name
){
2 $('link[title]').each(e
=> e
.disabled
= true);
3 $('link[title="' + name
+ '"]')[0].disabled
= false;
4 localStorage
.setItem("theme", name
);
6 if(name
== 'slate' || name
== 'cyborg')
7 $('.logo').each(e
=> e
.classList
.remove('logo-light'));
9 $('.logo').each(e
=> e
.classList
.add('logo-light'));
14 var theme_ul
= '<ul class="list-inline" id="themes">' +
15 '<li><a role="button" data-theme="cyborg">Black</a>' +
16 '<li><a role="button" data-theme="slate">Grey</a>' +
17 '<li><a role="button" data-theme="readable">White</a></ul>';
18 var sidebar
= $('#sidebar')[0];
19 sidebar
.insertBefore(m(theme_ul
), sidebar
.firstChild
);
20 $('#themes a').on('click', e
=> set_style(e
.target
.dataset
.theme
));
23 let theme
= localStorage
.getItem("theme");
25 if(theme
== "cerulean" || theme
== "cosmo")
This page took 0.046781 seconds and 5 git commands to generate.