Sha256: df0760430b30b9426b9ea415f1130e30d912ae65795c20e4d9ce8ee6cf663b69
Contents?: true
Size: 867 Bytes
Versions: 19
Compression:
Stored size: 867 Bytes
Contents
class Backbone.Poised.Textarea extends Backbone.Poised.View tagName: 'span' className: 'poised textarea' events: 'input textarea': 'updateAttributeValue' initialize: (options = {}) => throw new Error('Missing `model` option') unless options.model? throw new Error('Missing `attribute` option') unless options.attribute? @options = _.chain(options) .pick('rows', 'placeholder') .defaults rows: 3 placeholder: null .value() @attribute = options.attribute @model.on "change:#{@attribute}", @render updateAttributeValue: => @model.set(@attribute, @$textarea.val()) updateTextareaValue: (model, value) => val = value or @model.get(@attribute) @$textarea.val(val) render: => @$textarea = $ '<textarea>', @options @$el.html(@$textarea) @updateTextareaValue() this
Version data entries
19 entries across 19 versions & 1 rubygems