Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Expose the options for widgets called in mainline code. #1687

Closed
StevenBlack opened this issue May 22, 2011 · 2 comments
Closed

Expose the options for widgets called in mainline code. #1687

StevenBlack opened this issue May 22, 2011 · 2 comments
Assignees

Comments

@StevenBlack
Copy link
Contributor

Basically all the jQuery Mobile widgets like jquery.mobile.page.js and jquery.mobile.forms.button.js (10 of them in all) have fungible options that the developer cannot easily reach because these widgets are invoked in mainline jQuery Mobile code.

Background: the canonical way jQuery-UI widget options work is at invocation time, for example $( selector ).button( { ... options ...} ) as the widget is being created. These junctures in jQuery Mobile are buried.

Another way jQuery-UI widget options work is on an instance basis, for example $( selector ).button( "option", { ... options ...} ) changes an existing button. This is a problem for jQuery Mobile because some of our widgets are very DOM intensive, and it's not clear that this would even work in some cases, for example adding a back button to an existing page via `.page( "option", { addBackBth: true } ).

The best I could come-up with to globally enable back buttons (for example) is $.mobile.page.prototype.option( { addBackBtn: true } ); or $.mobile.page.prototype.options.addBackbutton= true;

The alternative to this is a long multiline pagebeforeshow hook that's a suboptimal kluge since this should be a fungible option.

@toddparker
Copy link
Contributor

Scott - is this still a valid concern after decoupling?

@ghost ghost assigned scottjehl Aug 8, 2011
@toddparker
Copy link
Contributor

This was addressed as part of the decoupling and we're working out the most minimal amount that can be considered core so closing as fixed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants