fix lighboxFactory close

stable
Juanfran 2015-05-26 13:26:34 +02:00
parent 7f34f6e0bf
commit 7c41b02faf
3 changed files with 5 additions and 2 deletions

View File

@ -131,6 +131,8 @@ CreateProject = ($rootscope, $repo, $confirm, $location, $navurls, $rs, $project
openLightbox()
console.log "link"
directive = {
link: link,
templateUrl: "project/wizard-create-project.html"

View File

@ -8,11 +8,12 @@ class LightboxFactory
elm = $("<div>")
.attr(name, true)
.attr("tg-bind-scope", true)
.addClass("remove-on-close")
if attrs
elm.attr(attrs)
elm.addClass("remove-on-close")
html = @compile(elm)(scope)
$(document.body).append(html)

View File

@ -56,7 +56,7 @@ describe "tgLightboxFactory", ->
lightboxFactoryService.create("fake-directive", attrs)
checkAttributes = sinon.match ( (value) ->
return value.attr("class") == "x1" && value.attr("id") == "x2"
return value.hasClass("x1") && value.attr("id") == "x2" && value.hasClass("remove-on-close")
), "checkAttributes"
expect(mocks.compile.withArgs(checkAttributes)).to.have.been.calledOnce