 
 # the lightboxContent hide/show doesn't have sense because is an IE hack
 class LightboxService extends taiga.Service
-    constructor: (@animationFrame) ->
+    constructor: (@animationFrame, @q) ->
 
     open: ($el) ->
+        defered = @q.defer()
+
         lightboxContent = $el.children().not(".close")
         lightboxContent.hide()
 


            users = getFilteredUsers(searchingText)
            render(users)

        $el.on "click", ".watcher-single", debounce 2000, (event) ->
            closeLightbox()

        @animationFrame.add =>
            $el.addClass("open")
            lightboxContent.show()
            defered.resolve()

        docEl = angular.element(document)
        docEl.on "keydown.lightbox", (e) =>
            code = if e.keyCode then e.keyCode else e.which
            @.close($el) if code == 27

        return defered.promise

    close: ($el) ->
        docEl = angular.element(document)
