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

This commit is contained in:
Julian Steinwachs 2015-01-24 09:44:48 +01:00
parent 40246e6e65
commit 69fdace49f

View File

@ -397,20 +397,17 @@ function watchHashChange(e)
{
if(e!=null){
var prevurlsplit = e.oldURL.split('#');
var newurlsplit = e.newURL.split('#');
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').on('click', function(e){
//e.stopPropagation();
//e.preventDefault();
//window.location.hash = '#' + prevhashstring;
//window.history.go(-1);
//});
} else {
window.history.pushState({showCloseButton:false},null,null);
$('.modal-back').css('display','none');
}