Skip to content

Commit

Permalink
[popup] Deal with the fact that hashchange will not happen if the pag…
Browse files Browse the repository at this point in the history
…e has already had a starting dialog hash key
  • Loading branch information
Gabriel Schulhof committed May 29, 2012
1 parent d716d3b commit ea385c3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions js/jquery.mobile.popup.js
Expand Up @@ -401,6 +401,7 @@ define( [ "jquery",
$( window ).one( "hashchange.popupBinder", function() {
realInstallListener();
});
$.mobile.urlHistory.ignoreNextHashChange = true;
$.mobile.path.set( activeEntry.url + $.mobile.dialogHashKey );
$.mobile.urlHistory.addNew( activeEntry.url + $.mobile.dialogHashKey, activeEntry.transition, activeEntry.title, activeEntry.pageUrl, activeEntry.role );
}
Expand All @@ -416,6 +417,12 @@ define( [ "jquery",
}

if ( $.mobile.hashListeningEnabled && !abort ) {
// Opera 11.62 build 1347 on Linux will not fire a hashchange when going back to an identical URL,
// so we need to set one up with a timeout - make sure _onHashChange reacts well to being called
// superfluously
this._teardownHashChangeTimeout = setTimeout( function() {
$( window ).trigger( "hashchange.popup" );
}, 300 );
window.history.back();
}
else {
Expand Down Expand Up @@ -571,6 +578,11 @@ define( [ "jquery",
_onHashChange: function( immediate ) {
this._haveNavHook = false;

if ( this._teardownHashChangeTimeout ) {
clearTimeout( this._teardownHashChangeTimeout );
this._teardownHashChangeTimeout = 0;
}

if ( this._myOwnHashChange ) {
this._myOwnHashChange = false;
this._inProgress = false;
Expand Down

0 comments on commit ea385c3

Please sign in to comment.