Conversation
Added option 'datatheme' to allow choosing theme swatch in jQuery Mobile. This option defaults to 'a'
|
This looks great just one minor thing for the attributes to be parsed correctly the option name should be just theme. |
|
Just changed the option name. Sorry about that, I'm still new to javascript but why would the attribute not get parsed correctly. I would just create the datepicker with "$('#datepicker-div').date({ datatheme: 'b' });" and it would apply the theme swatch 'b' to the datapicker would it not? |
|
no problem options in JQM are read from two places in the dom from html5 data attributes and from the options object passed to the function if called directly in JS. when you put data-theme="b" in your markup that means that the html5 data attribute name theme = b and correspondingly the option in the widget is named just theme. so if the option was named datatheme in your markup you would need to put data-datatheme="b" also you will see non of the other options have data before theme so this would be inconsistent. Hope that explains clearly |
|
I understand! That was the missing link I couldn't piece together - how an attribute becomes a "data-" JQM attribute. Thanks for the explanation. |
Added option 'datatheme' to allow choosing theme swatch in jQuery
Mobile. This option defaults to 'a'