mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-27 09:24:46 +00:00
find the next entry in the urlstack that isn't a dialog Fixes #1061
This commit is contained in:
parent
3b21481cee
commit
291bb306dd
1 changed files with 14 additions and 1 deletions
|
|
@ -660,7 +660,20 @@
|
|||
|
||||
//if there's a data-rel=back attr, go back in history
|
||||
if( $this.is( "[data-rel='back']" ) ){
|
||||
window.history.back();
|
||||
var currentIndex = $.mobile.urlHistory.activeIndex, backToIndex;
|
||||
|
||||
// for each history entry that is not the current page (currentIndex - 1)
|
||||
for(var i = currentIndex - 1; i >= 0; i--){
|
||||
backToIndex = i;
|
||||
|
||||
// break when we've found the first page that isn't a dialog
|
||||
if($.mobile.urlHistory.stack[i].url.indexOf(dialogHashKey) < 0 ){
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//use the difference between closest non dialog index and the current index
|
||||
window.history.go(backToIndex - currentIndex);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue