fixed back to home mobile #423
This commit is contained in:
@@ -829,7 +829,7 @@
|
||||
}
|
||||
};
|
||||
function onHistoryPopState(e){
|
||||
console.log('onPopState',e.state);
|
||||
console.log('onHistoryPopState',e.state);
|
||||
if(e.state.home){
|
||||
backToFrontPage(true);
|
||||
}
|
||||
@@ -2247,25 +2247,31 @@
|
||||
// |___/
|
||||
function backToFrontPage(pop_state){
|
||||
console.log('backToFrontPage', pop_state);
|
||||
closeAllModals();
|
||||
// assume we are going back to front page
|
||||
$('body').removeClass().addClass('path-frontpage');
|
||||
$('a[data-drupal-link-system-path="<front>"]').addClass('is-active');
|
||||
// close entrees
|
||||
if(_corpus_ready){
|
||||
_$corpus_canvas.trigger({'type':'close-all-entree'});
|
||||
_$corpus_canvas.trigger({'type':'scramble-collection'});
|
||||
}
|
||||
|
||||
if(typeof pop_state == "undefined" || !pop_state){
|
||||
console.log('backToFrontPage push state');
|
||||
state = {
|
||||
home:true,
|
||||
context:"home",
|
||||
caller:null
|
||||
if(!_is_mobile){
|
||||
closeAllModals();
|
||||
// assume we are going back to front page
|
||||
$('body').removeClass().addClass('path-frontpage');
|
||||
$('a[data-drupal-link-system-path="<front>"]').addClass('is-active');
|
||||
// close entrees
|
||||
if(_corpus_ready){
|
||||
_$corpus_canvas.trigger({'type':'close-all-entree'});
|
||||
_$corpus_canvas.trigger({'type':'scramble-collection'});
|
||||
}
|
||||
_states_history.unshift(state);
|
||||
history.pushState(state, null, _base_url+drupalSettings.path.currentLanguage);
|
||||
|
||||
if(typeof pop_state == "undefined" || !pop_state){
|
||||
console.log('backToFrontPage push state');
|
||||
state = {
|
||||
home:true,
|
||||
context:"home",
|
||||
caller:null
|
||||
}
|
||||
_states_history.unshift(state);
|
||||
history.pushState(state, null, _base_url+drupalSettings.path.currentLanguage);
|
||||
}
|
||||
}else{
|
||||
// if mobile reload the front page
|
||||
ajaxLoadContent({home: true, ajax_path: 'home_m/ajax', sys_path: 'frontpage'});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user