Sha256: 8355391cfbcc979736c7ce7dc3989fda956ba5878acce67c81757689a83bcad7

Contents?: true

Size: 446 Bytes

Versions: 6

Compression:

Stored size: 446 Bytes

Contents

# 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.CounterButton extends 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

6 entries across 6 versions & 1 rubygems

Version Path
modularity-rails-0.8.0 vendor/assets/javascripts/modules/counter_button.coffee
modularity-rails-0.7.1 vendor/assets/javascripts/modules/counter_button.coffee
modularity-rails-0.7.0 vendor/assets/javascripts/modules/counter_button.coffee
modularity-rails-0.6.3 vendor/assets/javascripts/modules/counter_button.coffee
modularity-rails-0.6.2 vendor/assets/javascripts/modules/counter_button.coffee
modularity-rails-0.6.1 vendor/assets/javascripts/modules/counter_button.coffee