Sha256: b6d757c1adca230e7612d2de5e080b2bf718008d2ad7d4d7b324d8487fceb80e

Contents?: true

Size: 654 Bytes

Versions: 5

Compression:

Stored size: 654 Bytes

Contents

#= require tao/form/shared/mixins/checkable

class Tao.Form.CheckboxBase extends TaoComponent

  @include Tao.Form.Mixins.Checkable

  @tag 'tao-check-box'

  @get 'indeterminate', ->
    @field?.prop 'indeterminate'

  @set 'indeterminate', (value) ->
    @field?.prop 'indeterminate', value

  _connected: ->
    @field = @jq.find('input:checkbox')
    @_bind()

  _bind: ->
    @on 'change', 'input[type=checkbox]', (e) =>
      @namespacedTrigger 'change'
      null

    @on 'click', '.checkbox-wrapper', (e) =>
      if @field.is(':enabled')
        @_toggleChecked()
        @namespacedTrigger 'change'
      false

  _disconnected: ->
    @off()

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tao_form-0.2.3 lib/assets/javascripts/tao/form/shared/fields/checkbox.coffee
tao_form-0.2.2 lib/assets/javascripts/tao/form/shared/fields/checkbox.coffee
tao_form-0.2.1 lib/assets/javascripts/tao/form/shared/fields/checkbox.coffee
tao_form-0.2.0 lib/assets/javascripts/tao/form/shared/fields/checkbox.coffee
tao_form-0.1.10 lib/assets/javascripts/tao/form/shared/fields/checkbox.coffee