Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[popup] Deal with the fact that hashchange will not happen if the pag…

…e has already had a starting dialog hash key
  • Loading branch information...
commit ea385c38dca888e7f54d77dca3e4b96c6e8367a9 1 parent d716d3b
@gabrielschulhof gabrielschulhof authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 js/jquery.mobile.popup.js
View
12 js/jquery.mobile.popup.js
@@ -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 );
}
@@ -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 {
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.