From 716e428f07c7983b58c4b17bdf016efe860944b9 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 12 Jan 2015 09:13:24 +0100 Subject: [PATCH] Added prevent default to markAllSeen click. --- .../app/controllers/widget/online_notification.js.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/controllers/widget/online_notification.js.coffee b/app/assets/javascripts/app/controllers/widget/online_notification.js.coffee index da4480653..f3a0689eb 100644 --- a/app/assets/javascripts/app/controllers/widget/online_notification.js.coffee +++ b/app/assets/javascripts/app/controllers/widget/online_notification.js.coffee @@ -56,7 +56,7 @@ class App.OnlineNotificationWidget extends App.Controller @stop() # show popover - items = App.OnlineNotification.search(sortBy: 'created_at', order: 'DESC' ) + items = App.OnlineNotification.search( sortBy: 'created_at', order: 'DESC' ) counter = 0 for item in items if !item.seen @@ -77,11 +77,15 @@ class App.OnlineNotificationWidget extends App.Controller # insert data $( App.view('widget/online_notification')(items: items)) ).on('shown.bs.popover', => + # show frontend times $('#markAllAsSeen').bind('click', (e) => + e.preventDefault() @markAllAsSeen(items) ); @frontendTimeUpdate() + ).on('hide.bs.popover', => + $('#markAllAsSeen').unbind('click') ) fetch: =>