From 52f5a247421d8e7a70d59b3f492ab71d4dfd1512 Mon Sep 17 00:00:00 2001 From: Bachir Soussi Chiadmi Date: Wed, 4 Apr 2018 15:16:31 +0200 Subject: [PATCH] trying to fix redirect to home bug : replaced cookie by localStorage, seems to work --- .../custom/edlptheme/assets/dist/scripts/main.min.js | 7 ++++--- sites/all/themes/custom/edlptheme/assets/scripts/main.js | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js b/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js index d5929c2ec..636a3326e 100644 --- a/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js +++ b/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js @@ -129,7 +129,7 @@ _$body.removeClass('ajax-loading'); }; function onAjaxLoaded(data, url, ajax_path, sys_path, selector){ - console.log('ajax loaded url:'+url+' ajax_path:'+ajax_path+' sys_path:'+sys_path+' data', data); + console.log('ajax loaded url:'+url+' ajax_path:'+ajax_path+' sys_path:'+sys_path); // reset all style may been added by other pages (like masonry for productions) // and replace all content with newly loaded @@ -272,8 +272,9 @@ history.replaceState(state, null, origin_url); // load content through ajax ajaxLoadContent(null, state.sys_path, state.ajax_path); - // reset the cookie - deleteCookie('edlp_origin_path'); + // reset the storage + window.localStorage.removeItem("edlp_origin_path"); + window.localStorage.removeItem("edlp_origin_url"); }else{ history.replaceState({home:true}, null, url); diff --git a/sites/all/themes/custom/edlptheme/assets/scripts/main.js b/sites/all/themes/custom/edlptheme/assets/scripts/main.js index d5929c2ec..636a3326e 100644 --- a/sites/all/themes/custom/edlptheme/assets/scripts/main.js +++ b/sites/all/themes/custom/edlptheme/assets/scripts/main.js @@ -129,7 +129,7 @@ _$body.removeClass('ajax-loading'); }; function onAjaxLoaded(data, url, ajax_path, sys_path, selector){ - console.log('ajax loaded url:'+url+' ajax_path:'+ajax_path+' sys_path:'+sys_path+' data', data); + console.log('ajax loaded url:'+url+' ajax_path:'+ajax_path+' sys_path:'+sys_path); // reset all style may been added by other pages (like masonry for productions) // and replace all content with newly loaded @@ -272,8 +272,9 @@ history.replaceState(state, null, origin_url); // load content through ajax ajaxLoadContent(null, state.sys_path, state.ajax_path); - // reset the cookie - deleteCookie('edlp_origin_path'); + // reset the storage + window.localStorage.removeItem("edlp_origin_path"); + window.localStorage.removeItem("edlp_origin_url"); }else{ history.replaceState({home:true}, null, url);