Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation needed for switch on off #4327

Closed
alvarotrigo opened this issue May 8, 2016 · 1 comment
Closed

Documentation needed for switch on off #4327

alvarotrigo opened this issue May 8, 2016 · 1 comment

Comments

@alvarotrigo
Copy link

It is provided in other components such as the slider:

Note: Although the value attribute is used to set a slider's initial value, it should not be used to modify the value programmatically; instead, use the MDL change() method. For example, assuming that slider1 is a slider object and newvalue is a variable containing the desired value, do not use slider1.value = newvalue; instead, use slider1.MaterialSlider.change(newvalue)

But totally omitted in the switch component.

$('#demo').get(0).MaterialSwitch.on();
$('#demo').get(0).MaterialSwitch.off();

Although I would also add another one as in the slider for a more easier coding based on a variable:

$('#demo').get(0).MaterialSwitch.change(true);
$('#demo').get(0).MaterialSwitch.change(false);
@Garbee
Copy link
Collaborator

Garbee commented Jul 11, 2016

We are overhauling the JS API in V2 and the V1 site/docs are in a maintenance/critical-only support mode from the core team. If someone from the community would like to contribute a patch for adding this, mdl-1.x is open for PRs.

Thank you.

@Garbee Garbee closed this as completed Jul 11, 2016
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

No branches or pull requests

2 participants