From 99d183085fe0cf6eca0ae82045a0a8e50c6ea2d6 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Wed, 14 Jan 2015 13:25:10 +0100 Subject: [PATCH] fix vertical align lightbox in IE --- app/coffee/modules/common/lightboxes.coffee | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/coffee/modules/common/lightboxes.coffee b/app/coffee/modules/common/lightboxes.coffee index 198db241..db0ff379 100644 --- a/app/coffee/modules/common/lightboxes.coffee +++ b/app/coffee/modules/common/lightboxes.coffee @@ -29,11 +29,21 @@ debounce = @.taiga.debounce ## Common Lightbox Services ############################################################################# +# the lightboxContent hide/show doesn't have sense because is an IE hack class LightboxService extends taiga.Service + constructor: (@animationFrame) -> + open: ($el) -> + lightboxContent = $el.children().not(".close") + lightboxContent.hide() + $el.css('display', 'flex') + $el.find('input,textarea').first().focus() - timeout(70, -> $el.addClass("open")) + + @animationFrame.add => + $el.addClass("open") + lightboxContent.show() docEl = angular.element(document) docEl.on "keydown.lightbox", (e) => @@ -56,7 +66,7 @@ class LightboxService extends taiga.Service @.close($(lightboxEl)) -module.service("lightboxService", LightboxService) +module.service("lightboxService", ["animationFrame", LightboxService]) class LightboxKeyboardNavigationService extends taiga.Service