Sha256: 53e6e9c6566a461e25360d111988d3b5e743a0c5a3b3654d211aeea3632046c9

Contents?: true

Size: 465 Bytes

Versions: 5

Compression:

Stored size: 465 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 'change', 'input[type=checkbox]', (e) =>
      @namespacedTrigger 'change'
      null

    @on 'click', '.switch-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/switch.coffee
tao_form-0.2.2 lib/assets/javascripts/tao/form/shared/fields/switch.coffee
tao_form-0.2.1 lib/assets/javascripts/tao/form/shared/fields/switch.coffee
tao_form-0.2.0 lib/assets/javascripts/tao/form/shared/fields/switch.coffee
tao_form-0.1.10 lib/assets/javascripts/tao/form/shared/fields/switch.coffee