This commit is contained in:
Kevin Ross 2015-12-07 17:38:14 -06:00
parent e0db93b7f5
commit 9fa2cde8d4
5 changed files with 15 additions and 10 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

7
dist/js/material.js vendored
View File

@ -30,6 +30,7 @@
$.material = {
"options": {
// These options set what will be started by $.material.init()
"validate": true,
"input": true,
"ripples": true,
"checkbox": true,
@ -133,6 +134,7 @@
});
},
"attachInputEventHandlers": function() {
var validate = this.options.validate;
// checkboxes didn't appear to bubble to the document, so we'll bind these directly
$(".form-group .checkbox label").hover(function() {
@ -166,12 +168,14 @@
//
// NOTE: I'm not sure we should be intervening regarding validation, this seems better as a README and snippet of code.
// BUT, I've left it here for backwards compatibility.
if(validate) {
if (isValid) {
$formGroup.removeClass("has-error");
}
else {
$formGroup.addClass("has-error");
}
}
})
.on("focus", ".form-control, .form-group.is-fileinput", function() {
_addFormGroupFocus(this);
@ -250,7 +254,8 @@
clearInterval(focused);
});
},
"init": function() {
"init": function(options) {
this.options = $.extend({}, this.options, options);
var $document = $(document);
if ($.fn.ripples && this.options.ripples) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long