Sha256: 4f900e58e530d9501acba3e2bec395d765def3e07a4211e560301141be82549a
Contents?: true
Size: 877 Bytes
Versions: 40
Compression:
Stored size: 877 Bytes
Contents
#= require underscore #= require backbone Rev.registerComponent 'CollectionSelectBox', getDefaultProps: -> props = collection: new Backbone.Collection() modelToKey: (model) -> model.id modelToValue: (model) -> model.id modelToChildContent: (model) -> model.id onChange: (e) -> return selectBoxClassName: "RevCollectionSelectBox" optionClassName: "RevCollectionSelectBox-option" onChange: (e) -> e.model = @props.collection.get e.currentTarget.value @props.onChange(e) render: -> @transferPropsTo <select className={@props.selectBoxClassName} onChange={@onChange}> { @props.collection.map => @renderOption.apply this, arguments } </select> renderOption: (model) -> <option key={@props.modelToKey model} value={@props.modelToValue model}> {@props.modelToChildContent model} </option>
Version data entries
40 entries across 40 versions & 1 rubygems