Browse Source

fixed bug: back button shows up when navigated to first modal in history

master
Julian Steinwachs 10 years ago
parent
commit
69fdace49f
  1. 19
      js/interface_common.js

19
js/interface_common.js

@ -397,20 +397,17 @@ function watchHashChange(e)
{ {
if(e!=null){ if(e!=null){
var prevurlsplit = e.oldURL.split('#'); var prevurlsplit = e.oldURL.split('#');
var newurlsplit = e.newURL.split('#'); var prevhashstring=prevurlsplit[1];
var prevhashstring=prevurlsplit[1];
if(prevurlsplit[0]==newurlsplit[0] && prevhashstring!=undefined && prevhashstring.length>0 ){ var notFirstModalView=(prevhashstring!=undefined && prevhashstring.length>0 );
var notNavigatedBackToFirstModalView=(window.history.state==null || ( window.history.state!=null && window.history.state.showCloseButton!=false ) )
if(notFirstModalView && notNavigatedBackToFirstModalView ) ){
$('.modal-back').css('display','inline'); $('.modal-back').css('display','inline');
//$('.modal-back').on('click', function(e){
//e.stopPropagation();
//e.preventDefault();
//window.location.hash = '#' + prevhashstring;
//window.history.go(-1);
//});
} else { } else {
window.history.pushState({showCloseButton:false},null,null);
$('.modal-back').css('display','none'); $('.modal-back').css('display','none');
} }

Loading…
Cancel
Save