Fix ##2399: Errors CRUD over admin > attributes items
parent
8aa88cf28d
commit
31e087a754
|
@ -165,10 +165,11 @@ ProjectValuesDirective = ($log, $repo, $confirm, $location, animationFrame) ->
|
||||||
$el.find(".new-value input:visible").first().focus()
|
$el.find(".new-value input:visible").first().focus()
|
||||||
|
|
||||||
saveValue = (target) ->
|
saveValue = (target) ->
|
||||||
form = target.parents("form").checksley()
|
formEl = target.parents("form")
|
||||||
|
form = formEl.checksley()
|
||||||
return if not form.validate()
|
return if not form.validate()
|
||||||
|
|
||||||
value = target.scope().value
|
value = formEl.scope().value
|
||||||
promise = $repo.save(value)
|
promise = $repo.save(value)
|
||||||
promise.then =>
|
promise.then =>
|
||||||
row = target.parents(".row.table-main")
|
row = target.parents(".row.table-main")
|
||||||
|
@ -179,7 +180,8 @@ ProjectValuesDirective = ($log, $repo, $confirm, $location, animationFrame) ->
|
||||||
form.setErrors(data)
|
form.setErrors(data)
|
||||||
|
|
||||||
saveNewValue = (target) ->
|
saveNewValue = (target) ->
|
||||||
form = target.parents("form").checksley()
|
formEl = target.parents("form")
|
||||||
|
form = formEl.checksley()
|
||||||
return if not form.validate()
|
return if not form.validate()
|
||||||
|
|
||||||
$scope.newValue.project = $scope.project.id
|
$scope.newValue.project = $scope.project.id
|
||||||
|
@ -199,7 +201,8 @@ ProjectValuesDirective = ($log, $repo, $confirm, $location, animationFrame) ->
|
||||||
|
|
||||||
cancel = (target) ->
|
cancel = (target) ->
|
||||||
row = target.parents(".row.table-main")
|
row = target.parents(".row.table-main")
|
||||||
value = target.scope().value
|
formEl = target.parents("form")
|
||||||
|
value = formEl.scope().value
|
||||||
$scope.$apply ->
|
$scope.$apply ->
|
||||||
row.addClass("hidden")
|
row.addClass("hidden")
|
||||||
value.revert()
|
value.revert()
|
||||||
|
@ -261,7 +264,9 @@ ProjectValuesDirective = ($log, $repo, $confirm, $location, animationFrame) ->
|
||||||
$el.on "click", ".delete-value", (event) ->
|
$el.on "click", ".delete-value", (event) ->
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
target = angular.element(event.currentTarget)
|
target = angular.element(event.currentTarget)
|
||||||
value = target.scope().value
|
formEl = target.parents("form")
|
||||||
|
value = formEl.scope().value
|
||||||
|
|
||||||
choices = {}
|
choices = {}
|
||||||
_.each $scope.values, (option) ->
|
_.each $scope.values, (option) ->
|
||||||
if value.id != option.id
|
if value.id != option.id
|
||||||
|
|
Loading…
Reference in New Issue