From d68293b46b13baa992919805d020d26a7de59313 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 25 Jul 2013 17:26:56 +0200 Subject: [PATCH] Moved back to permanent bindings (notify need be available the whole time). --- .../javascripts/app/controllers/notify.js.coffee | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/app/controllers/notify.js.coffee b/app/assets/javascripts/app/controllers/notify.js.coffee index 63a0f464c..60104dd36 100644 --- a/app/assets/javascripts/app/controllers/notify.js.coffee +++ b/app/assets/javascripts/app/controllers/notify.js.coffee @@ -1,26 +1,25 @@ class App.Notify extends Spine.Controller + className: 'container' events: 'click .alert': 'destroy' - className: 'container' - constructor: -> super - @bind 'notify', (data) => + App.Event.bind 'notify', (data) => @render(data) - @bind 'notify:removeall', => + App.Event.bind 'notify:removeall', => @log 'notify:removeall', @ @destroyAll() - @bind 'notifyDesktop', (data) => + App.Event.bind 'notifyDesktop', (data) => if !data['icon'] data['icon'] = 'unknown' notify.createNotification( data.msg, data ) # request desktop notification after login - @bind 'auth', (data) -> + App.Event.bind 'auth', (data) -> if !_.isEmpty(data) notify.requestPermission() @@ -47,7 +46,7 @@ class App.Notify extends Spine.Controller layout: 'top' type: data.type theme: 'noty_theme_twitter' - animateOpen: { + animateOpen: { height: 'toggle' opacity: 0.85, }, @@ -61,7 +60,7 @@ class App.Notify extends Spine.Controller closeOnSelfOver: false } ) - + destroy: (e) -> e.preventDefault() # $(e.target).parents('.alert').remove();