Sha256: 1b937e19d0f9309a935e30a5cc8761077a1beb294734af6db56ba7539d7cdf21

Contents?: true

Size: 405 Bytes

Versions: 8

Compression:

Stored size: 405 Bytes

Contents

namespace 'styleus.toggle', (exports) ->
  config = exports.config =
    toggleSelector: 'toggle'

  exports.install = (root) ->
    $root = $(root or document)
    $root.on 'click', "[data-#{config.toggleSelector}]", (event) ->
      event.preventDefault()
      link =  $(event.target)
      target = $root.find(link.data(config.toggleSelector))
      target.toggleClass('enabled') if target
      false

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
styleus-0.0.12 app/assets/javascripts/styleus/behaviors/toggle.js.coffee
styleus-0.0.11 app/assets/javascripts/styleus/behaviors/toggle.js.coffee
styleus-0.0.10 app/assets/javascripts/styleus/behaviors/toggle.js.coffee
styleus-0.0.9 app/assets/javascripts/styleus/behaviors/toggle.js.coffee
styleus-0.0.8 app/assets/javascripts/styleus/behaviors/toggle.js.coffee
styleus-0.0.7 app/assets/javascripts/styleus/behaviors/toggle.js.coffee
styleus-0.0.6 app/assets/javascripts/styleus/behaviors/toggle.js.coffee
styleus-0.0.5 app/assets/javascripts/styleus/behaviors/toggle.js.coffee