trying to fix redirect to home bug : replaced cookie by localStorage, seems to work

This commit is contained in:
Bachir Soussi Chiadmi
2018-04-04 15:16:31 +02:00
parent 4529db50a8
commit 52f5a24742
2 changed files with 8 additions and 6 deletions
@@ -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);
@@ -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);