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)
|
module.controller("ProjectValuesController", ProjectValuesController)
|
||||||
|
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
## Project values directive
|
## Project values directive
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
@ -228,8 +229,11 @@ ProjectValuesDirective = ($log, $repo, $confirm, $location, animationFrame) ->
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
target = angular.element(event.currentTarget)
|
target = angular.element(event.currentTarget)
|
||||||
row = target.parents(".row.table-main")
|
row = target.parents(".row.table-main")
|
||||||
row.hide()
|
value = target.scope().value
|
||||||
row.siblings(".visualization").css("display": "flex")
|
$scope.$apply ->
|
||||||
|
row.hide()
|
||||||
|
value.revert()
|
||||||
|
row.siblings(".visualization").css("display": "flex")
|
||||||
|
|
||||||
$el.on "click", ".delete-value", (event) ->
|
$el.on "click", ".delete-value", (event) ->
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
@ -262,7 +266,8 @@ ProjectValuesDirective = ($log, $repo, $confirm, $location, animationFrame) ->
|
||||||
|
|
||||||
return {link:link}
|
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-settings
|
||||||
|
|
||||||
div.project-values-body
|
div.project-values-body
|
||||||
form.sortable
|
div.sortable
|
||||||
div(ng-repeat="value in values")
|
form(ng-repeat="value in values")
|
||||||
div.project-values-row.row.table-main.visualization
|
div.project-values-row.row.table-main.visualization
|
||||||
span.icon.icon-drag-v
|
span.icon.icon-drag-v
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,8 @@ section.colors-table
|
||||||
div.options-column
|
div.options-column
|
||||||
|
|
||||||
div.table-main
|
div.table-main
|
||||||
form.sortable
|
div.sortable
|
||||||
div(ng-repeat="value in values")
|
form(ng-repeat="value in values")
|
||||||
div.row.table-main.visualization
|
div.row.table-main.visualization
|
||||||
span.icon.icon-drag-v
|
span.icon.icon-drag-v
|
||||||
div.color-column
|
div.color-column
|
||||||
|
|
|
@ -6,8 +6,8 @@ section.colors-table
|
||||||
div.options-column
|
div.options-column
|
||||||
|
|
||||||
div.table-main
|
div.table-main
|
||||||
form.sortable
|
div.sortable
|
||||||
div(ng-repeat="value in values")
|
form(ng-repeat="value in values")
|
||||||
div.row.table-main.visualization
|
div.row.table-main.visualization
|
||||||
span.icon.icon-drag-v
|
span.icon.icon-drag-v
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,8 @@ section.colors-table
|
||||||
div.options-column
|
div.options-column
|
||||||
|
|
||||||
div.table-main
|
div.table-main
|
||||||
form.sortable
|
div.sortable
|
||||||
div(ng-repeat="value in values")
|
form(ng-repeat="value in values")
|
||||||
div.row.table-main.visualization
|
div.row.table-main.visualization
|
||||||
span.icon.icon-drag-v
|
span.icon.icon-drag-v
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue