- We were missing a changepage notification in the case where we were transitioning to the same page.

- Added changepagefailed notification for the case where the load fails. Note we still need beforeloadpage/loadpage notifications.

- Misc fixes to stop the navigation unit tests from seemingly random failures. It seems that the hash resets in setup/teardown of the test modules sometimes interferes with the changePage() requests in the tests. Added code to the setup/teardown functions to wait for the reset to complete before moving on to the tests.
This commit is contained in:
Kin Blas 2011-06-10 10:00:25 -07:00
parent f605e100e4
commit b7bcf93620
3 changed files with 10 additions and 2 deletions

View file

@ -754,6 +754,7 @@
//release transition lock so navigation is free again
releasePageTransitionLock();
settings.pageContainer.trigger("changepagefailed");
});
return;
}
@ -780,6 +781,7 @@
// to the same page.
if( active && active.page[0] === toPage[0] ) {
isPageTransitioning = false;
mpc.trigger( "changepage" );
return;
}

View file

@ -6,7 +6,7 @@
originalTitle = document.title,
siteDirectory = location.pathname.replace(/[^/]+$/, "");
module('jquery.mobile.navigation.js', {
teardown: function(){
setup: function(){
$.mobile.urlHistory.stack = [];
$.mobile.urlHistory.activeIndex = 0;
$.mobile.changePage = changePageFn;

View file

@ -6,7 +6,13 @@
module('jquery.mobile.navigation.js', {
setup: function(){
location.hash = "";
if ( location.hash ) {
stop();
$(document).one("changepage", function() {
start();
} );
location.hash = "";
}
}
});