Permalink
Browse files

simply tack on another dialog state Fixes #4994

The alternate implementation here is to check if the current pages
data-url is already a part of the hash and replace it with just
the dialog hash key. This is dangerous though because it doesn't
account for dialog states either. This solution is simple and works
with the only downside being an odd url in an extreme corner case.
  • Loading branch information...
1 parent 2f8ef2f commit e625c958504a8dfb50ce78269b309bf8ef8fe55c @johnbender johnbender committed Sep 18, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 js/widgets/popup.js
View
@@ -153,7 +153,7 @@ define( [ "jquery",
// We need to adjust the history option to be false if there's no AJAX nav.
// We can't do it in the option declarations because those are run before
// it is determined whether there shall be AJAX nav.
- this.options.history = this.options.history && $.mobile.ajaxEnabled;
+ this.options.history = this.options.history && $.mobile.ajaxEnabled;
if ( thisPage.length === 0 ) {
thisPage = $( "body" );
@@ -731,7 +731,9 @@ define( [ "jquery",
// if the current url has no dialog hash key proceed as normal
// otherwise, if the page is a dialog simply tack on the hash key
- if ( url.indexOf( hashkey ) === -1 && !activePage.is( ".ui-dialog" ) ){
+ if ( url.indexOf( hashkey ) === -1
+ && !activePage.is( ".ui-dialog" )
+ && $.mobile.urlHistory.activeIndex !== 0 ){
url = url + hashkey;
} else {
url = $.mobile.path.parseLocation().hash + hashkey;

0 comments on commit e625c95

Please sign in to comment.