X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=js%2F90-themes.js;h=0b043b8e393adc21146c4a698286f441ea499f98;hb=911c62b8bdc652e0d33d33cd366905acdcb93290;hp=0bfa8bf839b2cb158da41c426e57fe9e00440538;hpb=5b01a19d266d33b2d0bfcd01ae3a924f4a742ec4;p=gruntmaster-page.git diff --git a/js/90-themes.js b/js/90-themes.js index 0bfa8bf..0b043b8 100644 --- a/js/90-themes.js +++ b/js/90-themes.js @@ -12,11 +12,19 @@ }); } + var selector; + + function add_themelink(theme, text) { + var link = $('' + text + ''); + link.appendTo(selector.find('ul')).wrap('
  • ').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 = $('
    Themes:
    '); + add_themelink('cyborg', 'Black'); + add_themelink('slate', 'Grey'); + add_themelink('readable', 'White'); + $('#sidebar').prepend(selector); }); var theme = localStorage.getItem("theme");