Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Dialog Link inside Nested Listview causes error (a4.1) #1512

Closed
Sacrelicious opened this issue Apr 25, 2011 · 6 comments
Closed

Dialog Link inside Nested Listview causes error (a4.1) #1512

Sacrelicious opened this issue Apr 25, 2011 · 6 comments

Comments

@Sacrelicious
Copy link

If you have a link you wish to display as a dialog inside a nested list, like so:

<div data-role="content">
    <ul data-role="listview" id="categories">
        <li id="category1">
             <ul id="subcategory1">
                 <li><a href="product1.html" data-rel="dialog">Product Info</a></li>
             </ul>
        </li>
    </ul>
</div>

clicking the link will result in the error: 'to.data("page") is undefined' on line 2371 in 1.0 Alpha 4.1.
Removing 'data-rel="dialog"' removes the problem, as does having the link in a non-nested listview.

@Sacrelicious
Copy link
Author

As a workaround, I changed line 2359 from
if(url.indexOf( "&" + $.mobile.subPageUrlKey ) > -1 ){
to
if(url.indexOf(dialogHashKey) == -1 && url.indexOf( "&" + $.mobile.subPageUrlKey ) > -1 ){
But I don't know if this has negative repercussions elsewhere.

@toddparker
Copy link
Contributor

I created a JS Bin demo of this code here for testing. I also added a text node on the top level li so it renders right:
http://jsbin.com/avuho5/edit

I think this will be fixed up with our navigation re-factor, let me know if you think this would be covered by these scenarios:
https://github.com/jquery/jquery-mobile/wiki/Refactor:-navigation-paths

@forrest
Copy link

forrest commented May 17, 2011

This is causing me significant problems also.

Thanks!

@gseguin
Copy link
Contributor

gseguin commented May 25, 2011

I can't reproduce with the latest master (a4ee2d5)

@toddparker
Copy link
Contributor

Looks like I should close this?

@Sacrelicious
Copy link
Author

I'm not sure how to check it using the latest master, but assuming gseguin is right, thanks for resolving this issue!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants