X-Git-Url: http://git.ieval.ro/?p=plack-app-gruntmaster.git;a=blobdiff_plain;f=js%2F90-themes.js;h=c280266f466e6ac7506ce355df3d4c8767bcdceb;hp=a61b4c0c0089983ff69f06341667ceb9f6d57e15;hb=81c2ef986ee0eba06af44f7830ee54be7e548bb3;hpb=502d9da0a5843c9ecef1a6226f98ed3d5a233dbc diff --git a/js/90-themes.js b/js/90-themes.js index a61b4c0..c280266 100644 --- a/js/90-themes.js +++ b/js/90-themes.js @@ -6,21 +6,13 @@ function set_style(name){ localStorage.setItem("theme", name); } -var theme_ul; - -function add_themelink(theme, text) { - theme_ul.innerHTML += '
  • ' + text + '' -} - $(function() { - theme_ul = document.createElement('ul'); - theme_ul.className = 'list-inline'; - theme_ul.id = 'themes'; - add_themelink('cyborg', 'Black'); - add_themelink('slate', 'Grey'); - add_themelink('readable', 'White'); + var theme_ul = ''; var sidebar = $('#sidebar')[0]; - sidebar.insertBefore(theme_ul, sidebar.firstChild); + sidebar.insertBefore(m(theme_ul), sidebar.firstChild); $('#themes a').on('click', function(e){ set_style(this.dataset.theme); });