Make JS a bit simpler
[plack-app-gruntmaster.git] / js / 90-mobilenav.js
index f8774214d5109fbab11460017dd1ab799bf2368b..bd47c8f90091af3f3fe1744931e6bae949f25748 100644 (file)
@@ -1,13 +1,6 @@
-(function(){
-       'use strict';
-
-       $( document ).ready(function(){
-               if(window.innerWidth >= 768)
-                       return;
-               $('#title').before('<div class="text-center">Tap title to toggle menu</div>');
-               $('nav').addClass('hidden');
-               $('#title').on('click', function () {
-                       $('nav').toggleClass('hidden');
-               });
-       });
-})();
+$(function(){
+       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.009266 seconds and 4 git commands to generate.