adding session storage to the header and events search widget
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 4 May 2017 11:58:43 +0000 (07:58 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 4 May 2017 11:58:43 +0000 (07:58 -0400)
using session storage to override the events list view if calendar is set. this is how
it's being done in the plugin so i'm also setting the sessionStorage variable when a search
is performed in the theme

index.php

index 1cd3344..3966d29 100644 (file)
--- a/index.php
+++ b/index.php
             jQuery(function(){
                 // 'Global' Namespace
                 var page = $('body');
-                
+                var event_search = page.find('.event-search');
                 // Search Namespace / Module
                 var search = ( function(){
                     
                     // Private members
                     var baseUrl     = '<?php echo home_url('/') ?>';
-                    var eventsPage  = '<?php echo get_permalink(330) ?>';
+                    var eventsPage  = '<?php echo get_permalink(131) ?>';
                     var url,queryType;
 
                     // Public members
                                     
                                 });
                             });
-                        },  
+                        },
                     }
                 })();
                 search.changeAction(search.getCatalogSearch(),search.getMainSearch(),search.getEventSearch(),search.getSearchForm());
+                
+                event_search.on('click', function(){
+                    sessionStorage.override = 'yes';
+                });
+
             });
         </script>
     </body>