Sha256: 7229b13529ea7b4af03361f30a86ac8a8d13c892219321b55beac6b5c11fc15d
Contents?: true
Size: 882 Bytes
Versions: 19
Compression:
Stored size: 882 Bytes
Contents
Luca.fields.CheckboxField = Luca.core.Field.extend form_field: true events: "change input" : "change_handler" change_handler: (e)-> me = my = $(e.currentTarget) @trigger "on:change", @, e if me.checked is true @trigger "checked" else @trigger "unchecked" className: 'luca-ui-checkbox-field luca-ui-field' template: 'fields/checkbox_field' hooks: ["checked","unchecked"] initialize: (@options={})-> _.extend @, @options _.bindAll @, "change_handler" Luca.core.Field::initialize.apply @, arguments afterInitialize: ()-> @input_id ||= _.uniqueId('field') @input_name ||= @name @input_value ||= 1 @label ||= @name setValue: (checked)-> @input.attr('checked', checked) getValue:()-> @input.attr('checked') is true Luca.register "checkbox_field", "Luca.fields.CheckboxField"
Version data entries
19 entries across 19 versions & 1 rubygems