]> iEval git - gruntmaster-page.git/blobdiff - js/90-themes.js
Merge branch 'master' into newmc
[gruntmaster-page.git] / js / 90-themes.js
index 0bfa8bf839b2cb158da41c426e57fe9e00440538..0b043b8e393adc21146c4a698286f441ea499f98 100644 (file)
                });
        }
 
+       var selector;
+
+       function add_themelink(theme, text) {
+               var link = $('<a role="button">' + text + '</a>');
+               link.appendTo(selector.find('ul')).wrap('<li>').on('click', function () { set_style(theme) });
+       }
+
        $( document ).ready(function() {
-               $('#theme-selector').detach().prependTo($('#sidebar'));
-               $('#theme_slate'   ).on('click', function () { set_style("slate"); });
-               $('#theme_cyborg'  ).on('click', function () { set_style("cyborg"); });
-               $('#theme_readable').on('click', function () { set_style("readable"); });
+               selector = $('<div>Themes: <ul class="list-inline"></ul></div>');
+               add_themelink('cyborg', 'Black');
+               add_themelink('slate', 'Grey');
+               add_themelink('readable', 'White');
+               $('#sidebar').prepend(selector);
        });
 
        var theme = localStorage.getItem("theme");
This page took 0.025951 seconds and 4 git commands to generate.