Sha256: 0dd65b01e957341b76272ff119961cbcdede1998e091b9c41c3ce30e1f320a26

Contents?: true

Size: 593 Bytes

Versions: 15

Compression:

Stored size: 593 Bytes

Contents

window.modularity.closable =

  constructor: (container) ->
    close_button = @container.find('.CloseButton')
    unless close_button?.length > 0
      window.alert 'Error: Close button not found'
    close_button.click => @close_button_clicked()


  # The events that can be fired by closable objects.
  events:
    closed: 'closed'


  # Called when the button got clicked by the user or programmatically.
  close_button_clicked: ->
    if @closable_closing
      return unless @closable_closing()
    @fire_event 'closed'
    @container.remove()
    @closable_closed() if @closable_closed

Version data entries

15 entries across 15 versions & 2 rubygems

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