Skip to content

Commit bdba60e

Browse files
author
scottjehl
committed
removed urlHistory references to (and use of) each entry's "page" property, which kept a reference to the DOM elements of each page that had been loaded. This fixes leaking memory on removed pages, and outsources page requests to the browser cache (for real this time :) ).
1 parent 5c01f3f commit bdba60e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

js/jquery.mobile.navigation.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,13 +257,13 @@
257257
},
258258

259259
// addNew is used whenever a new page is added
260-
addNew: function( url, transition, title, storedTo ) {
260+
addNew: function( url, transition, title ) {
261261
//if there's forward history, wipe it
262262
if( urlHistory.getNext() ) {
263263
urlHistory.clearForward();
264264
}
265265

266-
urlHistory.stack.push( {url : url, transition: transition, title: title, page: storedTo } );
266+
urlHistory.stack.push( {url : url, transition: transition, title: title } );
267267

268268
urlHistory.activeIndex = urlHistory.stack.length - 1;
269269
},
@@ -916,7 +916,7 @@
916916

917917
//add page to history stack if it's not back or forward
918918
if( !historyDir ) {
919-
urlHistory.addNew( url, settings.transition, pageTitle, toPage );
919+
urlHistory.addNew( url, settings.transition, pageTitle );
920920
}
921921

922922
//set page title
@@ -1191,7 +1191,7 @@
11911191
// prevent changepage
11921192
return;
11931193
} else {
1194-
var setTo = function() { to = $.mobile.urlHistory.getActive().page; };
1194+
var setTo = function() { to = $( ":jqmData(url='" + $.mobile.urlHistory.getActive().url + "')" ); };
11951195
// if the current active page is a dialog and we're navigating
11961196
// to a dialog use the dialog objected saved in the stack
11971197
urlHistory.directHashChange({ currentUrl: to, isBack: setTo, isForward: setTo });

0 commit comments

Comments
 (0)