Skip to content

Commit 5048242

Browse files
author
Gabriel Schulhof
committed
[dialog] When hash listening is disabled and going to the previous page 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 2eb8bcf commit 5048242

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

js/widgets/dialog.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,20 @@ $.widget( "mobile.dialog", $.mobile.widget, {
8383

8484
// Close method goes back in history
8585
close: function() {
86+
var dst;
87+
8688
if ( !this._isClosed ) {
8789
this._isClosed = true;
8890
if ( $.mobile.hashListeningEnabled ) {
8991
window.history.back();
9092
}
9193
else {
92-
$.mobile.changePage( $.mobile.urlHistory.getPrev().url );
94+
dst = $.mobile.urlHistory.getPrev().url;
95+
if ( !$.mobile.path.isPath( dst ) ) {
96+
dst = $.mobile.path.makeUrlAbsolute( "#" + dst );
97+
}
98+
99+
$.mobile.changePage( dst, { changeHash: false, fromHashChange: true } );
93100
}
94101
}
95102
}

0 commit comments

Comments
 (0)