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 ac7c0348e..3e4daa2a3 100644
--- a/app/assets/javascripts/app/controllers/widget/online_notification.js.coffee
+++ b/app/assets/javascripts/app/controllers/widget/online_notification.js.coffee
@@ -47,6 +47,7 @@ class App.OnlineNotificationWidget extends App.Controller
@toggle.append('
' + count.toString() + '
')
markAllAsRead: =>
+ @counterUpdate(0)
@ajax(
id: 'markAllAsRead'
type: 'POST'
@@ -64,13 +65,19 @@ class App.OnlineNotificationWidget extends App.Controller
@updateContent()
# set heigth of notification popover
- height = $('#app').height()
- $('.js-notificationsContainer').css('height', "#{height-12}px")
+ heightApp = $('#navigation').height()
+ heightPopoverHeader = $('.js-notificationsContainer .popover-notificationsHeader').height()
+ heightPopoverContent = $('.js-notificationsContainer .popover-content').get(0).scrollHeight
+ height = heightPopoverHeader + heightPopoverContent
+ if height > heightApp
+ height = heightApp - heightPopoverHeader - 56
+ $('.js-notificationsContainer .popover-content').css('height', "#{height}px")
+
+ # set popover arrow
$('.js-notificationsContainer .arrow').css('top', '20px')
# close notification list on click
$('.js-notificationsContainer').on('click', (e) =>
- #console.log('CL')
@hidePopover()
)