Fix for issue #2835 - pagechangefailed not triggered when changing to non-existent internal page

- Modified loadPage() so that it bails if an embedded page is not found within the DOM.
This commit is contained in:
jblas@adobe.com 2011-10-25 17:06:01 -07:00
parent 580b376566
commit 9a4eb1d833

View file

@ -743,9 +743,15 @@
}
// If we failed to find a page in the DOM, check the URL to see if it
// refers to the first page in the application.
if ( page.length === 0 && $.mobile.firstPage && path.isFirstPageUrl( fileUrl ) ) {
page = $( $.mobile.firstPage );
// refers to the first page in the application. If it isn't a reference
// to the first page and refers to non-existent embedded page, error out.
if ( page.length === 0 ) {
if ( $.mobile.firstPage && path.isFirstPageUrl( fileUrl ) ) {
page = $( $.mobile.firstPage );
} else if ( path.isEmbeddedPage( fileUrl ) ) {
deferred.reject( absUrl, options );
return deferred.promise();
}
}
// Reset base to the default document base.