Use document.documentElement.clientWidth instead of window.innerWidth
[plack-app-gruntmaster.git] / js / 90-mobilenav.js
index f8774214d5109fbab11460017dd1ab799bf2368b..c53666967596cf298dfabcfad404a75e1d5fcceb 100644 (file)
@@ -1,13 +1,7 @@
-(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(){
+       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').on('click', () => $('nav')[0].classList.toggle('hidden'));
+});
This page took 0.00937 seconds and 4 git commands to generate.