Fix #175: Validate project value and revert modifications if cancel button is clicked
parent
1fae3c9e9a
commit
33d18a173c
|
@ -93,6 +93,7 @@ class ProjectValuesController extends mixOf(taiga.Controller, taiga.PageMixin)
|
|||
|
||||
module.controller("ProjectValuesController", ProjectValuesController)
|
||||
|
||||
|
||||
#############################################################################
|
||||
## Project values directive
|
||||
#############################################################################
|
||||
|
@ -228,8 +229,11 @@ ProjectValuesDirective = ($log, $repo, $confirm, $location, animationFrame) ->
|
|||
event.preventDefault()
|
||||
target = angular.element(event.currentTarget)
|
||||
row = target.parents(".row.table-main")
|
||||
row.hide()
|
||||
row.siblings(".visualization").css("display": "flex")
|
||||
value = target.scope().value
|
||||
$scope.$apply ->
|
||||
row.hide()
|
||||
value.revert()
|
||||
row.siblings(".visualization").css("display": "flex")
|
||||
|
||||
$el.on "click", ".delete-value", (event) ->
|
||||
event.preventDefault()
|
||||
|
@ -262,7 +266,8 @@ ProjectValuesDirective = ($log, $repo, $confirm, $location, animationFrame) ->
|
|||
|
||||
return {link:link}
|
||||
|
||||
module.directive("tgProjectValues", ["$log", "$tgRepo", "$tgConfirm", "$tgLocation", "animationFrame", ProjectValuesDirective])
|
||||
module.directive("tgProjectValues", ["$log", "$tgRepo", "$tgConfirm", "$tgLocation", "animationFrame",
|
||||
ProjectValuesDirective])
|
||||
|
||||
|
||||
#############################################################################
|
||||
|
|
|
@ -8,8 +8,8 @@ section.project-values-table
|
|||
div.project-values-settings
|
||||
|
||||
div.project-values-body
|
||||
form.sortable
|
||||
div(ng-repeat="value in values")
|
||||
div.sortable
|
||||
form(ng-repeat="value in values")
|
||||
div.project-values-row.row.table-main.visualization
|
||||
span.icon.icon-drag-v
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ section.colors-table
|
|||
div.options-column
|
||||
|
||||
div.table-main
|
||||
form.sortable
|
||||
div(ng-repeat="value in values")
|
||||
div.sortable
|
||||
form(ng-repeat="value in values")
|
||||
div.row.table-main.visualization
|
||||
span.icon.icon-drag-v
|
||||
div.color-column
|
||||
|
|
|
@ -6,8 +6,8 @@ section.colors-table
|
|||
div.options-column
|
||||
|
||||
div.table-main
|
||||
form.sortable
|
||||
div(ng-repeat="value in values")
|
||||
div.sortable
|
||||
form(ng-repeat="value in values")
|
||||
div.row.table-main.visualization
|
||||
span.icon.icon-drag-v
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@ section.colors-table
|
|||
div.options-column
|
||||
|
||||
div.table-main
|
||||
form.sortable
|
||||
div(ng-repeat="value in values")
|
||||
div.sortable
|
||||
form(ng-repeat="value in values")
|
||||
div.row.table-main.visualization
|
||||
span.icon.icon-drag-v
|
||||
|
||||
|
|
Loading…
Reference in New Issue