Sha256: 8b39c209172964a9b0631b486edb51e3db3639f799fe9dd002f32400b9e58d86

Contents?: true

Size: 506 Bytes

Versions: 9

Compression:

Stored size: 506 Bytes

Contents

#= require modularity/modules/button

# A button that counts how often it is clicked.
# This is implemented as a subclass of Button, 
# to take advantage of the already existing functionality there.
class window.modularity.CounterButton extends modularity.Button

  constructor: ->
    super

    # Counts how often this button has been clicked so far.
    @click_count = 0


  # We override the event handler for the 'clicked' event here.
  container_clicked: =>
    @fire_event 'clicked', ++@click_count

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
modularity-rails-0.15.0 vendor/assets/javascripts/modularity/modules/counter_button.coffee
modularity-rails-0.14.0 vendor/assets/javascripts/modularity/modules/counter_button.coffee
modularity-rails-0.12.3 vendor/assets/javascripts/modularity/modules/counter_button.coffee
modularity-rails-0.12.2 vendor/assets/javascripts/modularity/modules/counter_button.coffee
modularity-rails-0.12.1 vendor/assets/javascripts/modularity/modules/counter_button.coffee
modularity-rails-0.12.0 vendor/assets/javascripts/modularity/modules/counter_button.coffee
modularity-rails-0.11.1 vendor/assets/javascripts/modularity/modules/counter_button.coffee
modularity-rails-0.11.0 vendor/assets/javascripts/modularity/modules/counter_button.coffee
modularity-rails-0.10.0 vendor/assets/javascripts/modularity/modules/counter_button.coffee