Skip to content

Added theme capability#14

Closed
aka-Ani wants to merge 2 commits intoarschmitz:masterfrom
aka-Ani:master
Closed

Added theme capability#14
aka-Ani wants to merge 2 commits intoarschmitz:masterfrom
aka-Ani:master

Conversation

@aka-Ani
Copy link
Contributor

@aka-Ani aka-Ani commented Mar 10, 2014

Added option 'datatheme' to allow choosing theme swatch in jQuery
Mobile. This option defaults to 'a'

Added option 'datatheme' to allow choosing theme swatch in jQuery
Mobile.  This option defaults to 'a'
@arschmitz
Copy link
Owner

This looks great just one minor thing for the attributes to be parsed correctly the option name should be just theme.

@aka-Ani
Copy link
Contributor Author

aka-Ani commented Mar 13, 2014

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?

@arschmitz
Copy link
Owner

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

@aka-Ani
Copy link
Contributor Author

aka-Ani commented Mar 13, 2014

I understand! That was the missing link I couldn't piece together - how an attribute becomes a "data-" JQM attribute. Thanks for the explanation.

@arschmitz arschmitz closed this in 3ce31fc Mar 27, 2014
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

Successfully merging this pull request may close these issues.

2 participants