]> iEval git - gruntmaster-page.git/commitdiff
Merge branch 'master' into newmc
authorMarius Gavrilescu <marius@ieval.ro>
Mon, 4 May 2015 12:08:39 +0000 (15:08 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Mon, 4 May 2015 12:08:39 +0000 (15:08 +0300)
Conflicts:
js/90-mobilenav.js

1  2 
js/90-mobilenav.js
js/90-nav.js
js/90-themes.js

diff --combined js/90-mobilenav.js
index 8c1e38a4b87071034efc9266857a67930f052c9c,36e7298b9b4b43e834b9fd6c7be2a41f97b72e45..9efe8fccb7b968b8759ab0d2cb78f50d51152771
@@@ -1,7 -1,6 +1,6 @@@
  $(function(){
-       if(document.documentElement.clientWidth >= 768)
-               return;
-       $('#title')[0].insertAdjacentHTML('beforebegin', '<div class="text-center">Tap title to toggle menu</div>');
-       $('nav')[0].classList.add('hidden');
-       $('#title,#logo').on('click', () => $('nav')[0].classList.toggle('hidden'));
+       const nav = $('nav')[0];
+       nav.classList.add('hidden-xs');
+       $('#title')[0].insertAdjacentHTML('beforebegin', '<div class="text-center visible-xs-block">Tap title to toggle menu</div>');
 -      $('#title').on('click', () => nav.classList.toggle('hidden-xs'));
++      $('#title,#logo').on('click', () => nav.classList.toggle('hidden-xs'));
  });
diff --combined js/90-nav.js
index 4412e3a89ff038d92b1ae9f916fd20639dbc9e5d,b4127d6390eb55977b1a5f4b7f0f2e5d060d31d9..746ccd70eda3e1f66c811eed9704c3600d68ee16
@@@ -6,12 -6,11 +6,12 @@@ const NAVS = 
        us: /^\/us\//,
        account: /^\/account$/,
        contribute: /^\/contribute$/,
 +      about: /^\/about$/,
  };
  
  $(function(){
-       let path = location.pathname;
-       for (let nav in NAVS)
+       const path = location.pathname;
+       for (const nav in NAVS)
                if(path.match(NAVS[nav]))
                        $('#nav-' + nav)[0].classList.add('active');
  });
diff --combined js/90-themes.js
index 4a7067e29e965d05c66b3ec8e62bf58fc0d9cde2,a9d9b5185ebf5f1bd905dffc0767b46841b7bf4e..6a4c6809dbbb3a7be503031d4823ebf0bcb1033d
@@@ -6,27 -6,18 +6,24 @@@ function set_style(name, trans)
        $('link[title]').each(e => e.disabled = true);
        $('link[title="' + name + '"]')[0].disabled = false;
        localStorage.setItem("theme", name);
 +      $(function() {
 +              if(name == 'slate' || name == 'cyborg')
 +                      $('img').each(e => e.setAttribute('src', e.getAttribute('src').replace('logos/light', 'logos/dark')));
 +              else
 +                      $('img').each(e => e.setAttribute('src', e.getAttribute('src').replace('logos/dark', 'logos/light')));
 +      });
  }
  
  $(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.03417 seconds and 4 git commands to generate.