adding window width checking to force mobile view to use agenda view
authorAnthony Talarico <talarico@gaslightmedia.com>
Fri, 12 May 2017 15:01:21 +0000 (11:01 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Fri, 12 May 2017 15:01:21 +0000 (11:01 -0400)
added a function that checks window width and returns true or false. used this during the
session overriding check in agenda view to force agenda view if below 640px

views/front/events/agenda.html

index 0c0b457..973d1b1 100644 (file)
             
             return retain_date = d;
         }
+        function in_mobile(){
+            if($(window).width() < 641 ){
+                return true;
+            } else {
+                return false;
+            }
+        }
+        console.log(in_mobile());
         months = JSON.parse(months);
 
 //        console.log(sessionStorage.view + " : " + sessionStorage.override);
             sessionStorage.override = 'yes';
         });
         
-        if( sessionStorage.view && sessionStorage.override === 'no' ){
+        if( sessionStorage.view && sessionStorage.override === 'no' && !in_mobile()){
             view = sessionStorage.view;
         } else if( sessionStorage.override === 'yes'){
             view = 'agenda';