fix #1493 add loader when the user delete a project
parent
bfcab13dfb
commit
57163aafb7
|
@ -134,7 +134,7 @@ module.directive("tgLbCreateProject", ["$rootScope", "$tgRepo", "$tgConfirm", "$
|
||||||
## Delete Project Lightbox Directive
|
## Delete Project Lightbox Directive
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
DeleteProjectDirective = ($repo, $rootscope, $auth, $location, $navUrls, $confirm, lightboxService) ->
|
DeleteProjectDirective = ($repo, $rootscope, $auth, $location, $navUrls, $confirm, lightboxService, tgLoader) ->
|
||||||
link = ($scope, $el, $attrs) ->
|
link = ($scope, $el, $attrs) ->
|
||||||
projectToDelete = null
|
projectToDelete = null
|
||||||
$scope.$on "deletelightbox:new", (ctx, project)->
|
$scope.$on "deletelightbox:new", (ctx, project)->
|
||||||
|
@ -145,10 +145,13 @@ DeleteProjectDirective = ($repo, $rootscope, $auth, $location, $navUrls, $confir
|
||||||
$el.off()
|
$el.off()
|
||||||
|
|
||||||
submit = ->
|
submit = ->
|
||||||
|
tgLoader.start()
|
||||||
|
lightboxService.close($el)
|
||||||
|
|
||||||
promise = $repo.remove(projectToDelete)
|
promise = $repo.remove(projectToDelete)
|
||||||
|
|
||||||
promise.then (data) ->
|
promise.then (data) ->
|
||||||
lightboxService.close($el)
|
tgLoader.pageLoaded()
|
||||||
$rootscope.$broadcast("projects:reload")
|
$rootscope.$broadcast("projects:reload")
|
||||||
$location.path($navUrls.resolve("home"))
|
$location.path($navUrls.resolve("home"))
|
||||||
$confirm.notify("success")
|
$confirm.notify("success")
|
||||||
|
@ -169,4 +172,4 @@ DeleteProjectDirective = ($repo, $rootscope, $auth, $location, $navUrls, $confir
|
||||||
return {link:link}
|
return {link:link}
|
||||||
|
|
||||||
module.directive("tgLbDeleteProject", ["$tgRepo", "$rootScope", "$tgAuth", "$tgLocation", "$tgNavUrls",
|
module.directive("tgLbDeleteProject", ["$tgRepo", "$rootScope", "$tgAuth", "$tgLocation", "$tgNavUrls",
|
||||||
"$tgConfirm", "lightboxService", DeleteProjectDirective])
|
"$tgConfirm", "lightboxService", "tgLoader", DeleteProjectDirective])
|
||||||
|
|
Loading…
Reference in New Issue