Make JS a bit simpler
[plack-app-gruntmaster.git] / js / 90-mobilenav.js
index fb575d9288a34f375e1118418be5181a87fdfeed..bd47c8f90091af3f3fe1744931e6bae949f25748 100644 (file)
@@ -1,7 +1,6 @@
 $(function(){
-       if(window.innerWidth >= 768)
-               return;
-       $('#title')[0].insertAdjacentHTML('beforebegin', '<div class="text-center">Tap title to toggle menu</div>');
-       $('nav')[0].classList.add('hidden');
-       $('#title').on('click', () => $('nav')[0].classList.toggle('hidden'));
+       const nav = q('nav');
+       nav.classList.add('hidden-xs');
+       q('#title').insertAdjacentHTML('beforebegin', '<div class="text-center visible-xs-block">Tap title to toggle menu</div>');
+       $('#title').on('click', () => nav.classList.toggle('hidden-xs'));
 });
This page took 0.008966 seconds and 4 git commands to generate.