From 63cdc10ea0d5b234b3557ddafaa54964bba327ae Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Fri, 12 May 2017 11:01:21 -0400 Subject: [PATCH] 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 --- views/front/events/agenda.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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'; -- 2.17.1