fix #2094 - restore issue properties spinner

stable
Juanfran 2015-01-29 10:07:02 +01:00
parent 2957fd2297
commit 22cef4ed2f
1 changed files with 18 additions and 16 deletions

View File

@ -207,9 +207,15 @@ IssueStatusButtonDirective = ($rootScope, $repo, $confirm, $loading, $qqueue, $t
}) })
$el.html(html) $el.html(html)
save = $qqueue.bindAdd (value, issue) => save = $qqueue.bindAdd (statusId) =>
$.fn.popover().closeAll()
issue = $model.$modelValue.clone()
issue.status = statusId
onSuccess = -> onSuccess = ->
$confirm.notify("success") $confirm.notify("success")
$model.$setViewValue(issue)
$rootScope.$broadcast("history:reload") $rootScope.$broadcast("history:reload")
$loading.finish($el.find(".level-name")) $loading.finish($el.find(".level-name"))
onError = -> onError = ->
@ -220,7 +226,7 @@ IssueStatusButtonDirective = ($rootScope, $repo, $confirm, $loading, $qqueue, $t
$loading.start($el.find(".level-name")) $loading.start($el.find(".level-name"))
$repo.save(value).then(onSuccess, onError) $repo.save(issue).then(onSuccess, onError)
$el.on "click", ".status-data", (event) -> $el.on "click", ".status-data", (event) ->
event.preventDefault() event.preventDefault()
@ -236,13 +242,7 @@ IssueStatusButtonDirective = ($rootScope, $repo, $confirm, $loading, $qqueue, $t
target = angular.element(event.currentTarget) target = angular.element(event.currentTarget)
$.fn.popover().closeAll() save(target.data("status-id"))
issue = $model.$modelValue.clone()
issue.status = target.data("status-id")
$model.$setViewValue(issue)
save($model.$modelValue, issue)
$scope.$watch $attrs.ngModel, (issue) -> $scope.$watch $attrs.ngModel, (issue) ->
render(issue) if issue render(issue) if issue
@ -294,12 +294,12 @@ IssueTypeButtonDirective = ($rootScope, $repo, $confirm, $loading, $qqueue, $tem
issue = $model.$modelValue.clone() issue = $model.$modelValue.clone()
issue.type = type issue.type = type
$model.$setViewValue(issue)
onSuccess = -> onSuccess = ->
$confirm.notify("success") $confirm.notify("success")
$model.$setViewValue(issue)
$rootScope.$broadcast("history:reload") $rootScope.$broadcast("history:reload")
$loading.finish($el.find(".level-name")) $loading.finish($el.find(".level-name"))
onError = -> onError = ->
$confirm.notify("error") $confirm.notify("error")
issue.revert() issue.revert()
@ -307,7 +307,7 @@ IssueTypeButtonDirective = ($rootScope, $repo, $confirm, $loading, $qqueue, $tem
$loading.finish($el.find(".level-name")) $loading.finish($el.find(".level-name"))
$loading.start($el.find(".level-name")) $loading.start($el.find(".level-name"))
$repo.save($model.$modelValue).then(onSuccess, onError) $repo.save(issue).then(onSuccess, onError)
$el.on "click", ".type-data", (event) -> $el.on "click", ".type-data", (event) ->
event.preventDefault() event.preventDefault()
@ -376,10 +376,10 @@ IssueSeverityButtonDirective = ($rootScope, $repo, $confirm, $loading, $qqueue,
issue = $model.$modelValue.clone() issue = $model.$modelValue.clone()
issue.severity = severity issue.severity = severity
$model.$setViewValue(issue)
onSuccess = -> onSuccess = ->
$confirm.notify("success") $confirm.notify("success")
$model.$setViewValue(issue)
$rootScope.$broadcast("history:reload") $rootScope.$broadcast("history:reload")
$loading.finish($el.find(".level-name")) $loading.finish($el.find(".level-name"))
onError = -> onError = ->
@ -387,9 +387,10 @@ IssueSeverityButtonDirective = ($rootScope, $repo, $confirm, $loading, $qqueue,
issue.revert() issue.revert()
$model.$setViewValue(issue) $model.$setViewValue(issue)
$loading.finish($el.find(".level-name")) $loading.finish($el.find(".level-name"))
$loading.start($el.find(".level-name")) $loading.start($el.find(".level-name"))
$repo.save($model.$modelValue).then(onSuccess, onError) $repo.save(issue).then(onSuccess, onError)
$el.on "click", ".severity-data", (event) -> $el.on "click", ".severity-data", (event) ->
event.preventDefault() event.preventDefault()
@ -459,10 +460,10 @@ IssuePriorityButtonDirective = ($rootScope, $repo, $confirm, $loading, $qqueue,
issue = $model.$modelValue.clone() issue = $model.$modelValue.clone()
issue.priority = priority issue.priority = priority
$model.$setViewValue(issue)
onSuccess = -> onSuccess = ->
$confirm.notify("success") $confirm.notify("success")
$model.$setViewValue(issue)
$rootScope.$broadcast("history:reload") $rootScope.$broadcast("history:reload")
$loading.finish($el.find(".level-name")) $loading.finish($el.find(".level-name"))
onError = -> onError = ->
@ -470,9 +471,10 @@ IssuePriorityButtonDirective = ($rootScope, $repo, $confirm, $loading, $qqueue,
issue.revert() issue.revert()
$model.$setViewValue(issue) $model.$setViewValue(issue)
$loading.finish($el.find(".level-name")) $loading.finish($el.find(".level-name"))
$loading.start($el.find(".level-name")) $loading.start($el.find(".level-name"))
$repo.save($model.$modelValue).then(onSuccess, onError) $repo.save(issue).then(onSuccess, onError)
$el.on "click", ".priority-data", (event) -> $el.on "click", ".priority-data", (event) ->
event.preventDefault() event.preventDefault()