Sha256: 7f9f32915121e920484dfb1895674661402530ff2b435b0e16b280af0747a769

Contents?: true

Size: 364 Bytes

Versions: 7

Compression:

Stored size: 364 Bytes

Contents

class Tao.Form.SwitchBase extends TaoComponent

  @include Tao.Form.Mixins.Checkable

  @tag 'tao-switch'

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

  _bind: ->
    @on 'click', '.switch-wrapper', (e) =>
      if @field.is(':enabled')
        @_toggleChecked()
        @trigger 'tao:change'
      false

  _disconnected: ->
    @off()

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tao_form-0.1.9 lib/assets/javascripts/tao/form/shared/fields/switch.coffee
tao_form-0.1.8 lib/assets/javascripts/tao/form/shared/fields/switch.coffee
tao_form-0.1.7 lib/assets/javascripts/tao/form/shared/fields/switch.coffee
tao_form-0.1.6 lib/assets/javascripts/tao/form/shared/fields/switch.coffee
tao_form-0.1.5 lib/assets/javascripts/tao/form/shared/fields/switch.coffee
tao_form-0.1.4 lib/assets/javascripts/tao/form/shared/fields/switch.coffee
tao_form-0.1.3 lib/assets/javascripts/tao/form/shared/fields/switch.coffee