Fix #795: Close lightbox only if buttons, ESC key or the X icon is pressed

stable
David Barragán Merino 2014-08-27 14:10:48 +02:00
parent f4d7c6e5eb
commit 54cbfd9c92
1 changed files with 1 additions and 6 deletions

View File

@ -31,11 +31,6 @@ class LightboxService extends taiga.Service
lightbox.addClass('open')
), 70
lightbox.on 'click', (e) =>
target = angular.element(e.target)
if target[0] == lightbox[0]
@close(lightbox)
$(document)
.on 'keydown.lightbox', (e) =>
code = if e.keyCode then e.keyCode else e.which
@ -43,7 +38,6 @@ class LightboxService extends taiga.Service
if code == 27
@close(lightbox)
close: (lightbox) ->
$(document).off('.lightbox')
lightbox
@ -53,6 +47,7 @@ class LightboxService extends taiga.Service
module.service("lightboxService", LightboxService)
LightboxDirective = (lightboxService) ->
link = ($scope, $el, $attrs) ->
$el.on "click", ".close", (event) ->