adding another sessionStorage variable instead of using a hidden field in the events
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 17 Jan 2017 15:31:28 +0000 (10:31 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 17 Jan 2017 15:31:28 +0000 (10:31 -0500)
search form. This makes setting and unsetting the variable easier than trying to
override POST data.

views/front/events/agenda.html

index 30e55e9..36b71b2 100644 (file)
         var main_content        = $("#main-content");
         var view                = '{$cal_view}';
         
+//        console.log(sessionStorage.view + " : " + sessionStorage.override);
         event_search.on('click', function(){
             sessionStorage.override = 'yes';
         });
 
         if( sessionStorage.view && sessionStorage.override === 'no' ){
             view = sessionStorage.view;
+        } else if( sessionStorage.override === 'yes'){
+            view = 'agenda';
         }
         
-        
         // AJAX FUNCTION ************************************************
         // Get calendar month via AJAX
         function eventsCalMonthAJAX(month) {
             view_select.val('agenda');
         }
         $("#glm-event-view-select").on("change", function (){
+            sessionStorage.override = 'no';
             sessionStorage.setItem("view", $(this).attr("value"));
             if($("#glm-event-view-select option:selected").val() === "calendar"){
                 eventsCalMonthAJAX(month_obj);