mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-12 00:23:11 +00:00
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:
parent
580b376566
commit
9a4eb1d833
1 changed files with 9 additions and 3 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue