From 121bf3c2715cf0363766df6d8ee3d9a575fe56fc Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 21 Mar 2016 16:48:43 +0100 Subject: [PATCH] Fixed keyboard navigation and min. height with empty online notification. --- .../app/controllers/widget/online_notification.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/app/controllers/widget/online_notification.coffee b/app/assets/javascripts/app/controllers/widget/online_notification.coffee index bcd83bda5..b2b420661 100644 --- a/app/assets/javascripts/app/controllers/widget/online_notification.coffee +++ b/app/assets/javascripts/app/controllers/widget/online_notification.coffee @@ -10,7 +10,6 @@ class App.OnlineNotificationWidget extends App.Controller 'click .js-item': 'hide' 'click .js-remove': 'removeItem' 'click .js-locationVerify': 'onItemClick' - 'keydown': 'listNavigate' elements: '.js-mark': 'mark' @@ -58,11 +57,13 @@ class App.OnlineNotificationWidget extends App.Controller ) $(window).on 'click.notifications', @hide + $(window).on 'keydown.notifications', @listNavigate @updateContent() release: -> $(window).off 'click.notifications' + $(window).off 'keydown.notifications' App.OnlineNotification.unsubscribe(@subscribeId) super @@ -99,7 +100,7 @@ class App.OnlineNotificationWidget extends App.Controller current.removeClass('is-hover') next.addClass('is-hover') else - prev = current.prev('.is-item') + prev = current.prev('.js-item') if prev.size() current.removeClass('is-hover') prev.addClass('is-hover') @@ -138,7 +139,7 @@ class App.OnlineNotificationWidget extends App.Controller heightApp = $('#app').height() heightPopoverSpacer = 22 heightPopoverHeader = @header.outerHeight(true) - heightPopoverContent = 0 + heightPopoverContent = 30 @item.each -> heightPopoverContent += @clientHeight if (heightPopoverHeader + heightPopoverContent + heightPopoverSpacer) > heightApp