hiroprotagonist / jquery.mobile.actionsheet

An actionsheet for jquerymobile
103 stars 34 forks source link

Isn't "data-role" the wrong attribute? #16

Closed dmnkhhn closed 12 years ago

dmnkhhn commented 12 years ago

Hey there!

I am using your plugin with the latest version of jQM and I wanted to have a plain button that opens the actionsheet. I have no idea how jQM < final have solved it but it's not enough to specify the data-icon attribute on a normal link (anymore?).

You are using "data-role='actionsheet'" but that doesn't allow me to style it like a button because jQM expects the element to have a data-role of "button".

I found a temporary fix by changing the selector in your file to $( ":jqmData(role='actionsheet')", this ).each(function() { to $( ":jqmData(action='actionsheet')", this ).each(function() {

It's not the best solution but it allows me to use a button as an opener.

Maybe you got a better idea on how to solve it?

– Dominik

hiroprotagonist commented 12 years ago

Hi You dont have to use the anchor tag. It should do the trick if you replace the a tag with a button tag.