Fix issues-to-sprint lightbox closing issue

stable
Daniel García 2018-11-27 14:07:44 +01:00 committed by Alex Hermida
parent 5341bd8b5a
commit 53a112d030
1 changed files with 8 additions and 10 deletions

View File

@ -937,17 +937,13 @@ $confirm, $q, attachmentsService, $template, $compile) ->
currentLoading = $loading().target($el.find(".add-existing-button")).start() currentLoading = $loading().target($el.find(".add-existing-button")).start()
if item.milestone if item.milestone
currentLoading.finish()
lightboxService.close($el)
sprintChangeConfirmAndSave(item) sprintChangeConfirmAndSave(item)
else else
onSuccess = -> onSuccess = ->
currentLoading.finish() close()
lightboxService.close($el)
$rootScope.$broadcast("#{$scope.objType}form:add:success", item) $rootScope.$broadcast("#{$scope.objType}form:add:success", item)
onError = -> onError = ->
currentLoading.finish() close()
lightboxService.close($el)
saveItem(item, onSuccess, onError) saveItem(item, onSuccess, onError)
sprintChangeConfirmAndSave = (item) -> sprintChangeConfirmAndSave = (item) ->
@ -960,7 +956,8 @@ $confirm, $q, attachmentsService, $template, $compile) ->
$confirm.ask(title, null, message).then (askResponse) -> $confirm.ask(title, null, message).then (askResponse) ->
onSuccess = -> onSuccess = ->
askResponse.finish() askResponse.finish()
lightboxService.close($el) lightboxService.closeAll()
$scope.lightboxOpen = false
$rootScope.$broadcast("#{$scope.objType}form:add:success", item) $rootScope.$broadcast("#{$scope.objType}form:add:success", item)
onError = -> onError = ->
@ -1005,8 +1002,9 @@ $confirm, $q, attachmentsService, $template, $compile) ->
createAttachments(data).then () -> createAttachments(data).then () ->
currentLoading.finish() currentLoading.finish()
close() close()
$rs[schema.model].getByRef(data.project, data.ref, schema.params).then (obj) -> if data.ref
$rootScope.$broadcast(broadcastEvent, obj) $rs[schema.model].getByRef(data.project, data.ref, schema.params).then (obj) ->
$rootScope.$broadcast(broadcastEvent, obj)
promise.then null, (data) -> promise.then null, (data) ->
currentLoading.finish() currentLoading.finish()
form.setErrors(data) form.setErrors(data)
@ -1026,7 +1024,7 @@ $confirm, $q, attachmentsService, $template, $compile) ->
close() close()
close = () -> close = () ->
lightboxService.close($el) lightboxService.closeAll()
$scope.lightboxOpen = false $scope.lightboxOpen = false
docEl = angular.element(document) docEl = angular.element(document)