Sha256: 91dbee9c291aa3358ce953b47076081069ec13d9617403b159ea57eba2091896

Contents?: true

Size: 934 Bytes

Versions: 2

Compression:

Stored size: 934 Bytes

Contents

_.def('Luca.fields.TextAreaField').extends('Luca.core.Field').with

  events:
    "keydown input" : "keydown_handler"
    "blur input" : "blur_handler"
    "focus input" : "focus_handler"

  template: 'fields/text_area_field'

  height: "200px"
  width: "90%"

  initialize: (@options={})->
    _.bindAll @, "keydown_handler"

    @input_id ||= _.uniqueId('field')
    @input_name ||= @name
    @label ||= @name
    @input_class ||= @class
    @input_value ||= ""
    @inputStyles ||= "height:#{ @height };width:#{ @width }"
    @placeHolder ||= ""

    Luca.core.Field::initialize.apply @, arguments

  setValue: (value)->
    $( @field() ).val(value)

  getValue: ()->
    $( @field() ).val()

  field: ()->
    @input = $("textarea##{ @input_id }", @el)

  keydown_handler: (e)->
    me = my = $( e.currentTarget )

  blur_handler: (e)->
    me = my = $( e.currentTarget )

  focus_handler: (e)->
    me = my = $( e.currentTarget )

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
luca-0.9.8 app/assets/javascripts/luca/components/fields/text_area_field.coffee
luca-0.9.76 src/components/fields/text_area_field.coffee