destroy lightbox scope on close

stable
Juanfran 2015-04-28 08:15:02 +02:00
parent 7829958548
commit 4ea48add11
2 changed files with 5 additions and 1 deletions

View File

@ -68,6 +68,8 @@ class LightboxService extends taiga.Service
$el.addClass('close')
if $el.hasClass("remove-on-close")
scope = $el.data("scope")
scope.$destroy()
$el.remove()
closeAll: ->

View File

@ -3,12 +3,14 @@ class LightboxFactory
constructor: (@rootScope, @compile) ->
create: (name) ->
scope = @rootScope.$new()
elm = $("<div>")
.attr(name, true)
.attr("tg-bind-scope", true)
.addClass("wizard-create-project")
.addClass("remove-on-close")
scope = @rootScope.$new()
html = @compile(elm)(scope)
$(document.body).append(html)