notice.js 406 B

123456789101112131415161718192021222324252627
  1. class app.views.Notice extends app.View
  2. @className: '_notice'
  3. @attributes:
  4. role: 'alert'
  5. constructor: (@type, @args...) -> super
  6. init: ->
  7. @activate()
  8. return
  9. activate: ->
  10. @show() if super
  11. return
  12. deactivate: ->
  13. @hide() if super
  14. return
  15. show: ->
  16. @html @tmpl("#{@type}Notice", @args...)
  17. @prependTo app.el
  18. return
  19. hide: ->
  20. $.remove @el
  21. return