docs(options): clarifies how to set options

This commit is contained in:
Unai Recio 2015-01-19 16:13:24 +00:00
parent 8a9b3da18d
commit a91098a20a

View File

@ -141,7 +141,7 @@ Every function expects an optional value that will be used as a selector for the
`$.material.ripples("#selector, #foobar")` will apply Ripples.js only to `#selector` and `#foobar`. `$.material.ripples("#selector, #foobar")` will apply Ripples.js only to `#selector` and `#foobar`.
The functions that allows an optional selector are `$.material.ripples`, `$.material.input`, `$.material.checkbox` and `$.material.radio`. The functions that allows an optional selector are `$.material.ripples`, `$.material.input`, `$.material.checkbox` and `$.material.radio`.
You can even override the default values using the `$.material.options` function. The default values are: You can even override the default values using the `$.extend` function. The default values are:
$.material.options = { $.material.options = {
"withRipples": ".btn:not(.btn-link), .card-image, .navbar a:not(.withoutripple), .nav-tabs a:not(.withoutripple), .withripple", "withRipples": ".btn:not(.btn-link), .card-image, .navbar a:not(.withoutripple), .nav-tabs a:not(.withoutripple), .withripple",
@ -150,6 +150,12 @@ You can even override the default values using the `$.material.options` function
"radioElements": ".radio > label > input[type=radio]" "radioElements": ".radio > label > input[type=radio]"
} }
So, for example:
$.extend($.material.options, {
inputElements: "input.form-control.material, textarea.form-control.material, select.form-control.material"
});
### Arrive.js support ### Arrive.js support
If you need to dynamically add elements to your DOM then you may need to include `Arrive.js` before `Material.js`. This will automatically apply `Material.js` to every new element added via JavaScript. If you need to dynamically add elements to your DOM then you may need to include `Arrive.js` before `Material.js`. This will automatically apply `Material.js` to every new element added via JavaScript.