From 73099cf556e7a8afa25adee074b346716f154a54 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Wed, 6 Aug 2014 09:23:57 +0200 Subject: [PATCH] fix block lightbox --- app/coffee/modules/common/lightboxes.coffee | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/coffee/modules/common/lightboxes.coffee b/app/coffee/modules/common/lightboxes.coffee index 7c4e5400..32f0178b 100644 --- a/app/coffee/modules/common/lightboxes.coffee +++ b/app/coffee/modules/common/lightboxes.coffee @@ -31,6 +31,15 @@ class LightboxService extends taiga.Service lightbox.addClass('open') ), 70 + $(document) + .on 'keydown.lightbox', (e) => + code = if e.keyCode then e.keyCode else e.which + + if code == 27 + @close(lightbox) + $(document).off('lightbox') + + close: (lightbox) -> lightbox .one "transitionend", () -> @@ -62,7 +71,7 @@ BlockLightboxDirective = (lightboxService) -> title = $attrs.title $el.find("h2.title").text(title) $scope.$on "block", -> - lightboxService.close($el) + lightboxService.open($el) $scope.$on "unblock", -> $model.$modelValue.is_blocked = false