Permalink
Browse files

[dialog] When hash listening is disabled and going to the previous pa…

…ge during close, correctly construct the URL for the previous page from the urlHistory entry and indicate that changePage is to go back in urlHistory rather than adding a new entry
1 parent 715f11e commit 66f37f6578accd1d1e8f04148420f408b0da9ed6 @gabrielschulhof gabrielschulhof committed Jul 5, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 js/jquery.mobile.dialog.js
@@ -83,13 +83,20 @@ $.widget( "mobile.dialog", $.mobile.widget, {
// Close method goes back in history
close: function() {
+ var dst;
+
if ( !this._isClosed ) {
this._isClosed = true;
if ( $.mobile.hashListeningEnabled ) {
window.history.back();
}
else {
- $.mobile.changePage( $.mobile.urlHistory.getPrev().url );
+ dst = $.mobile.urlHistory.getPrev().url;
+ if ( !$.mobile.path.isPath( dst ) ) {
+ dst = $.mobile.path.makeUrlAbsolute( "#" + dst );
+ }
+
+ $.mobile.changePage( dst, { changeHash: false, fromHashChange: true } );
}
}
}

0 comments on commit 66f37f6

Please sign in to comment.