This repository was archived by the owner on Oct 8, 2021. It is now read-only.
This repository was archived by the owner on Oct 8, 2021. It is now read-only.
Provide a user friendly method to set global options #1880
Closed
Activity
eddiemonge commentedon Jun 21, 2011
Or that can be passed a key value set of options.
gseguin commentedon Jun 21, 2011
Sure! So 4 signatures:
$.mobile.option(optionName)
returns the option value$.mobile.option([optionName_1,optionName_2, ...])
returns an array of option values$.mobile.option(optionName, newValue)
sets the option tonewValue
$.mobile.option([optionName_1, optionName_2, ...], [newValue_1, newValue_2, ...])
sets options to the respective valuesscottjehl commentedon Jun 22, 2011
Nice!
I could see this working well if the first argument was the plugin name ("page" in this case). that way it would be properly targeted to the correct plugin, and not global config.
gseguin commentedon Jun 22, 2011
$.mobile.option( plugin, optionName )
returns the option value$.mobile.option( plugin, [optionName_1,optionName_2, ...] )
returns an array of option values$.mobile.option( plugin, optionName, newValue )
sets the option tonewValue
$.mobile.option( plugin, [optionName_1, optionName_2, ...], [newValue_1, newValue_2, ...] )
sets options to the respective valuesscottjehl commentedon Jun 22, 2011
+1
eddiemonge commentedon Jun 22, 2011
scottjehl commentedon Jun 22, 2011
One thought: in the interest of keeping things concise until we really need to add more, would be it worth considering just one method for setting a widget option? That would address the concern above without adding a lot of code...
gseguin commentedon Jun 22, 2011
And keeping
$.mobile.option( plugin, optionName )
for read access, right?I think that makes sense, I don't think the batch version would be used that often anyway, would it?
toddparker commentedon Sep 27, 2011
Added to the feature request wiki:
https://github.com/jquery/jquery-mobile/wiki/Feature-Requests