Sha256: 6997946a36c35d72b29e84971c02f38b05cddf26c3cb3fad2dc63af79aac7d68

Contents?: true

Size: 949 Bytes

Versions: 16

Compression:

Stored size: 949 Bytes

Contents

Luca.fields.ButtonField = Luca.core.Field.extend
  form_field: true
  
  readOnly: true

  events: 
    "click input" : "click_handler"

  hooks:[
    "button:click"
  ]

  className: 'luca-ui-field luca-ui-button-field'
  
  template: 'fields/button_field'

  click_handler: (e)->
    me = my = $( e.currentTarget )
    @trigger "button:click"

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

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

    @template = "fields/button_field_link" if @icon_class?.length

  afterInitialize: ()->
    @input_id ||= _.uniqueId('button')
    @input_name ||= @name ||= @input_id
    @input_value ||= @label ||= @text
    @input_type ||= "button"
    @input_class ||= @class
    @icon_class ||= ""
    @icon_class = "icon-#{ @icon_class }" if @icon_class.length and !@icon_class.match(/^icon-/)

  setValue: ()-> true

Luca.register "button_field", "Luca.fields.ButtonField"

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
luca-0.8 src/components/fields/button_field.coffee
luca-0.7.92 src/components/fields/button_field.coffee
luca-0.7.91 src/components/fields/button_field.coffee
luca-0.7.9 src/components/fields/button_field.coffee
luca-0.7.8 src/components/fields/button_field.coffee
luca-0.7.7 src/components/fields/button_field.coffee
luca-0.7.6 src/components/fields/button_field.coffee
luca-0.7.5 src/components/fields/button_field.coffee
luca-0.7.4 src/components/fields/button_field.coffee
luca-0.7.3 src/components/fields/button_field.coffee
luca-0.7.2 src/components/fields/button_field.coffee
luca-0.7.0 src/components/fields/button_field.coffee
luca-0.6.9 src/components/fields/button_field.coffee
luca-0.6.8 src/components/fields/button_field.coffee
luca-0.6.7 src/components/fields/button_field.coffee
luca-0.6.6 src/components/fields/button_field.coffee