From bdba60efd5b197b00e39f71f86fafc4bae4570fc Mon Sep 17 00:00:00 2001 From: scottjehl Date: Fri, 29 Jul 2011 19:51:17 -0400 Subject: [PATCH] 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 :) ). --- js/jquery.mobile.navigation.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index 8b74b9be..98e1d211 100644 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -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 });