Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added base ModalWidget class for widgets that sould only work in modals (#59) #60

Merged
merged 3 commits into from
Feb 14, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions core/widget/modal_widget.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
define ['cs!widget'], (Widget) ->

class ModalWidget extends Widget
###
The ModalWidget is a base class that is meant to be used ONLY inside a
modal window.

It provides functionality related to the modal window such as the close
event.

Provided events:

- on_close: called when the modal is closed by the user (override the @close method)
###

initialize: () ->
@setup_events()

setup_events: () ->
###
Setup events needed by the modal window.
###

# Bind a callback to the close button of the modal
($ '.icon-close-modal').one 'click', @on_close