jquery-archive / jquery-mobile

jQuery Mobile Framework
https://jquerymobile.com
Other
9.68k stars 2.4k forks source link

dialog not opening within function upon upgrade to alpha 4 js #1472

Closed dowdie closed 13 years ago

dowdie commented 13 years ago

just changed to alpha 4 now my buttons that launch dialogs from a function no longer work

function

$('label.disclaimer').one("click", function(event) {

$('body').append('<a id="form-disclaimer" href="#form-disclaimer" data-rel="dialog" data-transition="pop"  data-theme="a" style="display:none"></a>');
$('a#form-disclaimer').click().remove();

});

button that launches function

div data-role="fieldcontain" f ieldset data-role="controlgroup" input name="Disclaimer" type="checkbox" id="Disclaimer" data-theme="a" / label for="Disclaimer" class="disclaimer" >Agree to be contacted *</label /fieldset /div

dialog

div data-role="dialog" id="form-disclaimer" div data-role="header" class="ui-bar-g" h1 class="modal">Agree to be contacted</h1 a href="" data-rel="back" data-icon="delete" title="Close" class="ui-bar-a">Close</a /div div data-role="content" p Yes, please contact me on any of the contact details ...../p a href="" data-rel="back" data-role="button" data-icon="arrow-r" data-iconpos="right" data-theme="f" class="f">Agree</a /div /div

toddparker commented 13 years ago

Hi - can you please add this code as a JS Bin of JS Fiddle example so we can do some testing? Also, please specify what platform/version this is seen in?

dowdie commented 13 years ago

Sorry Todd I didn't know about this but i'm glad you showed me this is great

url http://jsbin.com/akujo3/6

This works using safari web browser on pc and mac but not on mobile devices.

Problem only happened after updating to alpha 4 from alpha 3

cheers Andrew

toddparker commented 13 years ago

Thanks for the JS Bin page, makes it so much easier to debug. I just changed your handler from "click" to "vclick" which our new virtual click handler and it works great in iOS now. http://jsbin.com/akujo3/9/edit

Hope that helps!