mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-04 12:54:41 +00:00
- 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:
parent
f605e100e4
commit
b7bcf93620
3 changed files with 10 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,13 @@
|
|||
|
||||
module('jquery.mobile.navigation.js', {
|
||||
setup: function(){
|
||||
location.hash = "";
|
||||
if ( location.hash ) {
|
||||
stop();
|
||||
$(document).one("changepage", function() {
|
||||
start();
|
||||
} );
|
||||
location.hash = "";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue