From 182046f254f038016533fcd8807173d00eed84ad Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 10 Apr 2013 21:53:06 +0200 Subject: [PATCH] Close #1003. --- src/features.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/features.coffee b/src/features.coffee index 257c47c72..29696f9a7 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -54,6 +54,8 @@ Header = @setBarVisibility Conf['Header auto-hide'] $.sync 'Header auto-hide', @setBarVisibility + $.on d, 'CreateNotification', @createNotification + $.asap (-> d.body), -> return unless Main.isThisPageLegit() # Wait for #boardNavMobile instead of #boardNavDesktop, @@ -188,6 +190,11 @@ Header = menuToggle: (e) -> Header.menu.toggle e, @, g + createNotification: (e) -> + {type, content, lifetime, cb} = e.detail + notif = new Notification type, content, lifetime + cb notif if cb + class Notification constructor: (type, content, @timeout) -> @add = add.bind @