trying to fix redirect to home bug : replaced cookie by localStorage, seems to work
This commit is contained in:
@@ -129,7 +129,7 @@
|
|||||||
_$body.removeClass('ajax-loading');
|
_$body.removeClass('ajax-loading');
|
||||||
};
|
};
|
||||||
function onAjaxLoaded(data, url, ajax_path, sys_path, selector){
|
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)
|
// reset all style may been added by other pages (like masonry for productions)
|
||||||
// and replace all content with newly loaded
|
// and replace all content with newly loaded
|
||||||
@@ -272,8 +272,9 @@
|
|||||||
history.replaceState(state, null, origin_url);
|
history.replaceState(state, null, origin_url);
|
||||||
// load content through ajax
|
// load content through ajax
|
||||||
ajaxLoadContent(null, state.sys_path, state.ajax_path);
|
ajaxLoadContent(null, state.sys_path, state.ajax_path);
|
||||||
// reset the cookie
|
// reset the storage
|
||||||
deleteCookie('edlp_origin_path');
|
window.localStorage.removeItem("edlp_origin_path");
|
||||||
|
window.localStorage.removeItem("edlp_origin_url");
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
history.replaceState({home:true}, null, url);
|
history.replaceState({home:true}, null, url);
|
||||||
|
|||||||
@@ -129,7 +129,7 @@
|
|||||||
_$body.removeClass('ajax-loading');
|
_$body.removeClass('ajax-loading');
|
||||||
};
|
};
|
||||||
function onAjaxLoaded(data, url, ajax_path, sys_path, selector){
|
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)
|
// reset all style may been added by other pages (like masonry for productions)
|
||||||
// and replace all content with newly loaded
|
// and replace all content with newly loaded
|
||||||
@@ -272,8 +272,9 @@
|
|||||||
history.replaceState(state, null, origin_url);
|
history.replaceState(state, null, origin_url);
|
||||||
// load content through ajax
|
// load content through ajax
|
||||||
ajaxLoadContent(null, state.sys_path, state.ajax_path);
|
ajaxLoadContent(null, state.sys_path, state.ajax_path);
|
||||||
// reset the cookie
|
// reset the storage
|
||||||
deleteCookie('edlp_origin_path');
|
window.localStorage.removeItem("edlp_origin_path");
|
||||||
|
window.localStorage.removeItem("edlp_origin_url");
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
history.replaceState({home:true}, null, url);
|
history.replaceState({home:true}, null, url);
|
||||||
|
|||||||
Reference in New Issue
Block a user