Always have 3 sort elements in sort selection modal.

pull/1306/head
Richard 11 years ago
parent dac8a1ca44
commit 932d7fe0da
  1. 10
      app/assets/javascripts/angular/controllers/dialogs/sorting.js
  2. 4
      app/assets/javascripts/angular/services/query-service.js

@ -52,6 +52,10 @@ angular.module('openproject.workPackages.controllers')
return [$scope.availableColumnsData.filter(function(column) { return column.id == element.field; })[0],
$scope.availableDirectionsData.filter(function(direction) { return direction.id == element.direction; })[0]]
});
while($scope.sortElements.length < 3) {
$scope.sortElements.push([]);
}
}
$scope.getAvailableColumnsData = function(term, result) {
@ -63,7 +67,11 @@ angular.module('openproject.workPackages.controllers')
}
$scope.updateSortation = function(){
var sortElements = $scope.sortElements.map(function(element){
var sortElements = $scope.sortElements
.filter(function(element){
return element.length == 2;
})
.map(function(element){
return { field: element[0].id, direction: element[1].id }
})
QueryService.updateSortElements(sortElements);

@ -134,7 +134,6 @@ angular.module('openproject.services')
return QueryService.doGet(url, function(response){
availableColumns = response.data.available_columns;
return availableColumns;
<<<<<<< HEAD
});
},
@ -147,9 +146,6 @@ angular.module('openproject.services')
this.hideColumns(currentColumns.map(function(column) { return column.name; }));
this.showColumns(selectedColumnNames);
=======
})
>>>>>>> Temp solution - moved sortation watcher to wp controller.
},
updateSortElements: function(sortation) {

Loading…
Cancel
Save