Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useModal option not working #121

Closed
barnese opened this issue Nov 18, 2011 · 7 comments
Closed

useModal option not working #121

barnese opened this issue Nov 18, 2011 · 7 comments

Comments

@barnese
Copy link

barnese commented Nov 18, 2011

I just ran into an issue where the datebox is no longer opening as a modal popup in the default Android 2.2 browser. It seems to work fine in desktop webkit browsers, but not in Android. I have the useModal option set to true. Please see the code sample below. What's interesting is the datebox displays below the lorem ipsum div. Am I missing another option to get the popup behavior?

Thanks and kudos to you for all the hard work on the datebox. It's awesome!

<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Datebox Test</title>

    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
    <link type="text/css" href="http://dev.jtsage.com/cdn/datebox/latest/jquery.mobile.datebox.min.css" rel="stylesheet" /> 

    <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script> 
    <script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
    <script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/latest/jquery.mobile.datebox.min.js"></script>
</head>
<body>
    <div id="myPage" data-role="page">  
        <div data-role="content">
            <input name="calDatebox" type="date" data-role="datebox" data-options='{"mode": "calbox", "useModal": "true"}' />
            <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer eu augue erat, a ullamcorper risus.</div>
        </div>
    </div>
</body>
@jtsage
Copy link
Owner

jtsage commented Nov 18, 2011

I have no idea. I've copied and pasted your code as-is.

http://dev.jtsage.com/jQM-DateBox/tests/d2.html works exactly as expected.

However, http://jsfiddle.net/jtsage/fqApZ/1/ fails like you said.

I'll keep looking, but the only thing I noticed is that it really should be "useModal": true (it's a boolean, not a string) - but even at that, your code works exactly as expected when I pasted it into a blank file...

@jtsage
Copy link
Owner

jtsage commented Nov 19, 2011

oh, and yes, Android 2.2 stock here. Epic 4G, just updated.

@barnese
Copy link
Author

barnese commented Nov 19, 2011

I gave "useModal": true a shot, but that didn't seem to make a difference.

Another clue though: it appears if I rollback jquery.mobile.datebox.js to your first commit on Nov 18, 2011 ("Missed a few use cases on the magic updating set button") it works fine. It appears the problem is in the second commit on Nov 18 ('Add option "forceInheritTheme" as a halfway meetign with #110') where the modal popup stops working. Any ideas?

@barnese
Copy link
Author

barnese commented Nov 19, 2011

I dug a little deeper. It seems to be the lines (1072,1073) that cause the issue:

pickPage = $ ("< div data-role='dialog' class='ui-dialog-datebox' data-theme='" + (o.forceInheritTheme === true ) ? thisTheme : o.pickPageTheme + "' >" +
"< div data-role='header' data-backbtn='false'>" +

If I replace those with the previous version's lines, it works fine.

jtsage added a commit that referenced this issue Nov 19, 2011
@jtsage
Copy link
Owner

jtsage commented Nov 19, 2011

Hmm. that is odd. Ok, rolling back part of that on my end fixes it too. Actually, I just qualified the inline if statement a bit more and swapped the operators. I also specified the theme for the header again - I don't think it's really needed, but it does seem to help.

@barnese
Copy link
Author

barnese commented Nov 19, 2011

Works great, thanks! :)

@barnese barnese closed this as completed Nov 19, 2011
@jtsage
Copy link
Owner

jtsage commented Nov 19, 2011

Woot. Thank you for working through it with me :)

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

No branches or pull requests

2 participants