Sha256: c0bd919734be029fe79933f8ecd22cad91cb1dbdf3d81ead950145311a6c2430

Contents?: true

Size: 537 Bytes

Versions: 13

Compression:

Stored size: 537 Bytes

Contents

# This mixin adds a 'clickable' aspect to modules.
# This means clicking anywhere on the module fires the 'clicked' event.
window.modularity.clickable =

  constructor: ->
    @container.click @container_clicked


  # Events that are fired by this mixin.
  events:
    clicked: 'clicked'

  
  # Programmatically click this clickable element.
  # For testing and scripting.
  click: -> @container.click()


  # Event handler for clicks on this clickable element. 
  container_clicked: -> @fire_event modularity.clickable.events.clicked

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
modularity-rails-0.15.0 vendor/assets/javascripts/modularity/mixins/clickable.coffee
modularity-rails-0.14.0 vendor/assets/javascripts/modularity/mixins/clickable.coffee
modularity-rails-0.12.3 vendor/assets/javascripts/modularity/mixins/clickable.coffee
modularity-rails-0.12.2 vendor/assets/javascripts/modularity/mixins/clickable.coffee
modularity-rails-0.12.1 vendor/assets/javascripts/modularity/mixins/clickable.coffee
modularity-rails-0.12.0 vendor/assets/javascripts/modularity/mixins/clickable.coffee
modularity-rails-0.11.1 vendor/assets/javascripts/modularity/mixins/clickable.coffee
modularity-rails-0.11.0 vendor/assets/javascripts/modularity/mixins/clickable.coffee
modularity-rails-0.10.0 vendor/assets/javascripts/modularity/mixins/clickable.coffee
modularity-rails-0.9.3 vendor/assets/javascripts/mixins/clickable.coffee
modularity-rails-0.9.2 vendor/assets/javascripts/mixins/clickable.coffee
modularity-rails-0.9.1 vendor/assets/javascripts/mixins/clickable.coffee
modularity-rails-0.9.0 vendor/assets/javascripts/mixins/clickable.coffee