]> iEval git - gruntmaster-page.git/blame - js/90-themes.js
Merge branch 'master' into newmc
[gruntmaster-page.git] / js / 90-themes.js
CommitLineData
c7a5e4e0
MG
1(function(){
2 'use strict';
3 function set_style(name){
d53c616a
MG
4 $('link[rel~="stylesheet"]').prop('disabled', true);
5 $('link[title="' + name + '"]').prop('disabled', false);
c7a5e4e0 6 localStorage.setItem("theme", name);
59731c89
MG
7 $(document).ready(function() {
8 if(name == 'slate' || name == 'cyborg')
9 $('.logo').removeClass('logo-light');
10 else
11 $('.logo').addClass('logo-light');
12 });
c7a5e4e0 13 }
7dc32473 14
c7a5e4e0 15 $( document ).ready(function() {
5fdcdc91 16 $('#theme-selector').detach().prependTo($('#sidebar'));
c7a5e4e0 17 $('#theme_slate' ).on('click', function () { set_style("slate"); });
c7a5e4e0 18 $('#theme_cyborg' ).on('click', function () { set_style("cyborg"); });
a96f684c 19 $('#theme_readable').on('click', function () { set_style("readable"); });
7dc32473
MG
20 });
21
c7a5e4e0
MG
22 var theme = localStorage.getItem("theme");
23 if(theme) {
a96f684c
MG
24 if(theme == "cerulean" || theme == "cosmo")
25 theme = "readable";
c7a5e4e0
MG
26 set_style(theme);
27 }
28})();
This page took 0.037148 seconds and 4 git commands to generate.