Sha256: 4b0576054cd83ec91dac288d16ee8bc8596a14599c93ec3f485db5665ac29a25

Contents?: true

Size: 582 Bytes

Versions: 4

Compression:

Stored size: 582 Bytes

Contents

window.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

4 entries across 4 versions & 1 rubygems

Version Path
modularity-rails-0.8.1 vendor/assets/javascripts/mixins/closable.coffee
modularity-rails-0.8.0 vendor/assets/javascripts/mixins/closable.coffee
modularity-rails-0.7.1 vendor/assets/javascripts/mixins/closable.coffee
modularity-rails-0.7.0 vendor/assets/javascripts/mixins/closable.coffee