From: Anthony Talarico Date: Fri, 12 May 2017 15:01:21 +0000 (-0400) Subject: adding window width checking to force mobile view to use agenda view X-Git-Tag: v1.6.38^2~2^2~4 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=63cdc10ea0d5b234b3557ddafaa54964bba327ae;p=WP-Plugins%2Fglm-member-db-events.git adding window width checking to force mobile view to use agenda view 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 --- diff --git a/views/front/events/agenda.html b/views/front/events/agenda.html index 0c0b457..973d1b1 100644 --- a/views/front/events/agenda.html +++ b/views/front/events/agenda.html @@ -149,6 +149,14 @@ 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); @@ -156,7 +164,7 @@ 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';