Sha256: 6e832cc7fa151a551921b07b84576e39253b5f0bf322d607cc46248fadba9391
Contents?: true
Size: 1.3 KB
Versions: 8
Compression:
Stored size: 1.3 KB
Contents
(function() { Rev.registerComponent('CollectionSelectBox', { getDefaultProps: function() { var props; return props = { collection: new Backbone.Collection(), modelToKey: function(model) { return model.id; }, modelToValue: function(model) { return model.id; }, modelToChildContent: function(model) { return model.id; }, onChange: function(e) {}, selectBoxClassName: "RevCollectionSelectBox", optionClassName: "RevCollectionSelectBox-option" }; }, onChange: function(e) { e.model = this.props.collection.get(e.currentTarget.value); return this.props.onChange(e); }, render: function() { return this.transferPropsTo(React.createElement("select", { "className": this.props.selectBoxClassName, "onChange": this.onChange }, this.props.collection.map((function(_this) { return function() { return _this.renderOption.apply(_this, arguments); }; })(this)))); }, renderOption: function(model) { return React.createElement("option", { "key": this.props.modelToKey(model), "value": this.props.modelToValue(model) }, this.props.modelToChildContent(model)); } }); }).call(this);
Version data entries
8 entries across 8 versions & 1 rubygems