Browse Source

added matchmedia max-width=799px to js for auto classic (responsive) nav

bach 2 years ago
parent
commit
9767f9ccfd
1 changed files with 4 additions and 1 deletions
  1. 4 1
      sites/all/themes/gui/perfarttimeline/js/script.js

+ 4 - 1
sites/all/themes/gui/perfarttimeline/js/script.js

@@ -75,7 +75,10 @@ Drupal.behaviors.init_timeline.attach = function (context) {
 
     function init(){
 
-      if(readCookie('advanced-nav') != 'yes' && readCookie('classic-nav') != 'yes'){
+      let isMobile = window.matchMedia("only screen and (max-width: 799px)").matches;
+      if(isMobile){
+        initClassic();
+      }else if(readCookie('advanced-nav') != 'yes' && readCookie('classic-nav') != 'yes'){
         
         $.getJSON(_drupalBasePath+'perfart/ajax/home', function(data){  
           console.log('data', data);