Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for issue 1243 - Can't link to dynamically created data-role="page"

- Modified loadPage() so that if the data-url lookup for a given page fails, that it look for the page via id (if it is an embedded page URL). This allows us to find dynamically injected pages that are un-enhanced and missing their data-url attributes.
  • Loading branch information...
commit 80b0e9979899cac49f9e13f677c83532c8c1bf4b 1 parent 61eed99
Kin Blas jblas authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 js/jquery.mobile.navigation.js
9 js/jquery.mobile.navigation.js
View
@@ -662,6 +662,15 @@
// Check to see if the page already exists in the DOM.
page = settings.pageContainer.children( ":jqmData(url='" + dataUrl + "')" );
+ // If we failed to find the page, check to see if the url is a
+ // reference to an embedded page. If so, it may have been dynamically
+ // injected by a developer, in which case it would be lacking a data-url
+ // attribute and in need of enhancement.
+ if ( page.length === 0 && !path.isPath( dataUrl ) ) {
+ page = settings.pageContainer.children( "#" + dataUrl )
+ .attr( "data-" + $.mobile.ns + "url", dataUrl )
+ }
+
// 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( absUrl ) ) {
Please sign in to comment.
Something went wrong with that request. Please try again.