Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removed urlHistory references to (and use of) each entry's "page" pro…

…perty, 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 :) ).
  • Loading branch information...
commit bdba60efd5b197b00e39f71f86fafc4bae4570fc 1 parent 5c01f3f
scottjehl authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 js/jquery.mobile.navigation.js
8 js/jquery.mobile.navigation.js
View
@@ -257,13 +257,13 @@
},
// addNew is used whenever a new page is added
- addNew: function( url, transition, title, storedTo ) {
+ addNew: function( url, transition, title ) {
//if there's forward history, wipe it
if( urlHistory.getNext() ) {
urlHistory.clearForward();
}
- urlHistory.stack.push( {url : url, transition: transition, title: title, page: storedTo } );
+ urlHistory.stack.push( {url : url, transition: transition, title: title } );
urlHistory.activeIndex = urlHistory.stack.length - 1;
},
@@ -916,7 +916,7 @@
//add page to history stack if it's not back or forward
if( !historyDir ) {
- urlHistory.addNew( url, settings.transition, pageTitle, toPage );
+ urlHistory.addNew( url, settings.transition, pageTitle );
}
//set page title
@@ -1191,7 +1191,7 @@
// prevent changepage
return;
} else {
- var setTo = function() { to = $.mobile.urlHistory.getActive().page; };
+ var setTo = function() { to = $( ":jqmData(url='" + $.mobile.urlHistory.getActive().url + "')" ); };
// if the current active page is a dialog and we're navigating
// to a dialog use the dialog objected saved in the stack
urlHistory.directHashChange({ currentUrl: to, isBack: setTo, isForward: setTo });

1 comment on commit bdba60e

John Bender

Looks good to me as long as the tests are passing (in this case there are MANY), though in general I'm not a huge fan of referencing/finding pages via the data url. Another good example is the nested pages in listview, we currently select them as child pages based on the url which seems complex and fragile.

Anyway, thoughts for another time. I'm for landing it if the tests are passing.

Please sign in to comment.
Something went wrong with that request. Please try again.