Sha256: 51cef4698b46ca23cf1c2d13d9f9de2d32cbfd8b6e75c407d95013c1483f2ee5

Contents?: true

Size: 604 Bytes

Versions: 12

Compression:

Stored size: 604 Bytes

Contents

class Backbone.Poised.StringControl extends Backbone.Poised.BaseControl
  initialize: (options = {}) ->
    super

    @options = _.chain(options)
      .pick('model', 'attribute', 'rows', 'placeholder')
      .defaults
        type: 'text'
        placeholder: null
        rows: 1
      .value()

  render: =>
    super

    if @options.rows > 1
      @subviews.textarea = new Backbone.Poised.Textarea(@options)
      @$el.append(@subviews.textarea.render().el)
    else
      @subviews.textfield = new Backbone.Poised.Textfield(@options)
      @$info.append(@subviews.textfield.render().el)

    this

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ela-4.0.0 app/js/vendor/backbone.poised/form/string_control.coffee
ela-3.4.3 app/js/vendor/backbone.poised/form/string_control.coffee
ela-3.4.2 app/js/vendor/backbone.poised/form/string_control.coffee
ela-3.4.0 app/js/vendor/backbone.poised/form/string_control.coffee
ela-3.3.1 app/js/vendor/backbone.poised/form/string_control.coffee
ela-3.3.0 app/js/vendor/backbone.poised/form/string_control.coffee
ela-3.2.0 app/js/vendor/backbone.poised/form/string_control.coffee
ela-3.1.1 app/js/vendor/backbone.poised/form/string_control.coffee
ela-3.1.0 app/js/vendor/backbone.poised/form/string_control.coffee
ela-3.0.0 app/js/vendor/backbone.poised/form/string_control.coffee
ela-2.0.0 app/js/vendor/backbone.poised/form/string_control.coffee
ela-1.1.0 app/js/vendor/backbone.poised/form/string_control.coffee