Sha256: ab7ce328bb8aa6e18e190c2e01b2313eddda8aac398de96968f4f33e7d2df531
Contents?: true
Size: 1.6 KB
Versions: 16
Compression:
Stored size: 1.6 KB
Contents
I"Y(function() { Rev.appMixin('ModelInputMixin', { componentDidMount: function() { return this.props.model.set(this.props.field, this.defaultValue()); }, defaultValue: function() { return this.props.defaultValue || this.value(); }, value: function() { var _ref; if (((_ref = this.props.model) != null ? _ref.get : void 0) != null) { return this.props.model.get(this.props.field); } }, klass: function() { return _.str.underscored(this.props.model.constructor.name); }, name: function() { return this.props.name || ((this.props.baseName || this.klass()) + "[" + this.props.field + "]"); }, isCheckbox: function() { return this.props.type === 'checkbox'; }, onFieldChange: function(e) { if (this.isCheckbox()) { this.props.model.set(this.props.field, e.target.checked); } else { this.props.model.set(this.props.field, e.target.value); } if (this.props.onChange != null) { return this.props.onChange(e); } }, onBlur: function(e) { var error, response, validator; validator = this.props.model["validate" + (_.str.classify(this.props.field))]; if (validator != null) { error = validator.bind(this.props.model)(); if (error) { response = { responseJSON: { errors: {} } }; response.responseJSON.errors[this.props.field] = [error]; return this.props.model.trigger('error', this.props.model, response, {}); } } } }); }).call(this); :ET
Version data entries
16 entries across 16 versions & 1 rubygems