From 682f6492b3dc6123842ee44a627fa9fe89c548c4 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Tue, 9 Sep 2014 09:56:17 +0200 Subject: [PATCH] fix user keyboard navigation --- app/coffee/modules/common/lightboxes.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/coffee/modules/common/lightboxes.coffee b/app/coffee/modules/common/lightboxes.coffee index 6e13e98c..edad6f5d 100644 --- a/app/coffee/modules/common/lightboxes.coffee +++ b/app/coffee/modules/common/lightboxes.coffee @@ -84,6 +84,7 @@ class LightboxKeyboardNavigationService extends taiga.Service prev.addClass('active') init: ($el) -> + @stop() docEl = angular.element(document) docEl.on "keydown.keyboard-navigation", (event) => code = if event.keyCode then event.keyCode else event.which @@ -486,7 +487,7 @@ WatchersLightboxDirective = ($repo, lightboxService, lightboxKeyboardNavigationS # and without now watched users. getFilteredUsers = (text="") -> _filterUsers = (text, user) -> - if _.find(selectedItem.watchers, (x) -> x == user.id) + if selectedItem && _.find(selectedItem.watchers, (x) -> x == user.id) return false username = user.full_name_display.toUpperCase()