Sha256: f995f270bfd63da44b9578c675dc5636833432f2557e0f2c77da4c42a588978c

Contents?: true

Size: 980 Bytes

Versions: 19

Compression:

Stored size: 980 Bytes

Contents

class Backbone.Poised.LinkedStringControl extends Backbone.Poised.LinkedControl
  initialize: (options = {}) =>
    super

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

  render: =>
    super

    if @options.rows > 1
      @subviews.textarea1 = new Backbone.Poised.Textarea(_.defaults(model: @model1, @options))
      @$control1.append(@subviews.textarea1.render().el)
      @subviews.textarea2 = new Backbone.Poised.Textarea(_.defaults(model: @model2, @options))
      @$control2.append(@subviews.textarea2.render().el)
    else
      @subviews.textfield1 = new Backbone.Poised.Textfield(_.defaults(model: @model1, @options))
      @$control1.append(@subviews.textfield1.render().el)
      @subviews.textfield2 = new Backbone.Poised.Textfield(_.defaults(model: @model2, @options))
      @$control2.append(@subviews.textfield2.render().el)

    this

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ela-4.1.6 app/js/vendor/backbone.poised/form/linked_string_control.coffee
ela-4.1.5 app/js/vendor/backbone.poised/form/linked_string_control.coffee
ela-4.1.4 app/js/vendor/backbone.poised/form/linked_string_control.coffee
ela-4.1.3 app/js/vendor/backbone.poised/form/linked_string_control.coffee
ela-4.1.2 app/js/vendor/backbone.poised/form/linked_string_control.coffee
ela-4.1.1 app/js/vendor/backbone.poised/form/linked_string_control.coffee
ela-4.1.0 app/js/vendor/backbone.poised/form/linked_string_control.coffee
ela-4.0.0 app/js/vendor/backbone.poised/form/linked_string_control.coffee
ela-3.4.3 app/js/vendor/backbone.poised/form/linked_string_control.coffee
ela-3.4.2 app/js/vendor/backbone.poised/form/linked_string_control.coffee
ela-3.4.0 app/js/vendor/backbone.poised/form/linked_string_control.coffee
ela-3.3.1 app/js/vendor/backbone.poised/form/linked_string_control.coffee
ela-3.3.0 app/js/vendor/backbone.poised/form/linked_string_control.coffee
ela-3.2.0 app/js/vendor/backbone.poised/form/linked_string_control.coffee
ela-3.1.1 app/js/vendor/backbone.poised/form/linked_string_control.coffee
ela-3.1.0 app/js/vendor/backbone.poised/form/linked_string_control.coffee
ela-3.0.0 app/js/vendor/backbone.poised/form/linked_string_control.coffee
ela-2.0.0 app/js/vendor/backbone.poised/form/linked_string_control.coffee
ela-1.1.0 app/js/vendor/backbone.poised/form/linked_string_control.coffee