Merge branch 'master' into newmc
[gruntmaster-page.git] / js / 90-themes.js
index 4a7067e29e965d05c66b3ec8e62bf58fc0d9cde2..6a4c6809dbbb3a7be503031d4823ebf0bcb1033d 100644 (file)
@@ -15,18 +15,15 @@ function set_style(name, trans){
 }
 
 $(function() {
-       var theme_ul = '<ul class="list-inline" id="themes">' +
+       const theme_ul = '<ul class="list-inline" id="themes">' +
                '<li><a role="button" data-theme="cyborg">Black</a>' +
                '<li><a role="button" data-theme="slate">Grey</a>' +
                '<li><a role="button" data-theme="readable">White</a></ul>';
-       var sidebar = $('#sidebar')[0];
+       const sidebar = $('#sidebar')[0];
        sidebar.insertBefore(m(theme_ul), sidebar.firstChild);
        $('#themes a').on('click', e => set_style(e.target.dataset.theme, true));
 });
 
-let theme = localStorage.getItem("theme");
-if(theme) {
-       if(theme == "cerulean" || theme == "cosmo")
-               theme = "readable";
-       set_style(theme, false);
-}
+const theme = localStorage.getItem("theme");
+if(theme)
+       set_style(theme == "cerulean" || theme == "cosmo" ? "readable" : theme, false);
This page took 0.010022 seconds and 4 git commands to generate.