Fix bug #1080: Imposible to reorder custom project attributes

stable
David Barragán Merino 2014-09-24 18:20:25 +02:00
parent bcd046f30c
commit a167a1a6dc
1 changed files with 3 additions and 2 deletions

View File

@ -71,10 +71,11 @@ class ProjectValuesController extends mixOf(taiga.Controller, taiga.PageMixin)
@scope.$emit('project:loaded', project)
return project
loadValues: =>
loadValues: ->
return @rs[@scope.resource].listValues(@scope.projectId, @scope.type).then (values) =>
@scope.values = values
@scope.maxValueOrder = _.max(values, "order").order
return values
loadInitialData: ->
promise = @repo.resolve({pslug: @params.pslug}).then (data) =>
@ -86,7 +87,7 @@ class ProjectValuesController extends mixOf(taiga.Controller, taiga.PageMixin)
@.loadValues(),
]))
moveValue: debounce 2000, (ctx, itemValue, itemIndex) =>
moveValue: (ctx, itemValue, itemIndex) =>
values = @scope.values
r = values.indexOf(itemValue)
values.splice(r, 1)