Fixed bug #722: Now is easier to close the lightbox

stable
Jesús Espino 2014-08-19 16:08:59 +02:00
parent a5747af1a8
commit 6e04267b63
1 changed files with 5 additions and 0 deletions

View File

@ -31,6 +31,11 @@ class LightboxService extends taiga.Service
lightbox.addClass('open') lightbox.addClass('open')
), 70 ), 70
lightbox.on 'click', (e) =>
target = angular.element(e.target)
if target[0] == lightbox[0]
@close(lightbox)
$(document) $(document)
.on 'keydown.lightbox', (e) => .on 'keydown.lightbox', (e) =>
code = if e.keyCode then e.keyCode else e.which code = if e.keyCode then e.keyCode else e.which