Sha256: f7e29b9e2573f6914d9ee8ec29d59a4196926916220d013e23272c4addfd4544
Contents?: true
Size: 1.6 KB
Versions: 57
Compression:
Stored size: 1.6 KB
Contents
I"V(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
57 entries across 52 versions & 2 rubygems