X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;ds=inline;f=js%2F90-themes.js;h=0b043b8e393adc21146c4a698286f441ea499f98;hb=21dc66dbe148a63d1e056e3b3c03933889392fc2;hp=0bfa8bf839b2cb158da41c426e57fe9e00440538;hpb=bffec365a2e7fa722c8a5ed515acdc3c07a3a4aa;p=plack-app-gruntmaster.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 = $('');
+ add_themelink('cyborg', 'Black');
+ add_themelink('slate', 'Grey');
+ add_themelink('readable', 'White');
+ $('#sidebar').prepend(selector);
});
var theme = localStorage.getItem("theme");