Sha256: 10c79e407ab31dd300e615b7abadf3ec420ff0b66a88be341202bfb45bbd0e37

Contents?: true

Size: 515 Bytes

Versions: 7

Compression:

Stored size: 515 Bytes

Contents

# This mixin adds a 'clickable' aspect to modules.
# This means clicking anywhere on the module fires the 'clicked' event.
window.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 clickable.events.clicked

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
modularity-rails-0.8.1 vendor/assets/javascripts/mixins/clickable.coffee
modularity-rails-0.8.0 vendor/assets/javascripts/mixins/clickable.coffee
modularity-rails-0.7.1 vendor/assets/javascripts/mixins/clickable.coffee
modularity-rails-0.7.0 vendor/assets/javascripts/mixins/clickable.coffee
modularity-rails-0.6.3 vendor/assets/javascripts/mixins/clickable.coffee
modularity-rails-0.6.2 vendor/assets/javascripts/mixins/clickable.coffee
modularity-rails-0.6.1 vendor/assets/javascripts/mixins/clickable.coffee