OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/app/assets/javascripts/angular/work_packages/column-context-menu.js

52 lines
1.4 KiB

angular.module('openproject.workPackages')
.factory('ColumnContextMenu', [
'ngContextMenu',
function(ngContextMenu) {
return ngContextMenu({
controller: 'ColumnContextMenuController',
controllerAs: 'contextMenu',
templateUrl: '/templates/work_packages/column_context_menu.html'
});
}])
.controller('ColumnContextMenuController', [
'$scope',
'ColumnContextMenu',
'I18n',
'QueryService',
'WorkPackagesTableHelper',
'WorkPackagesTableService',
function($scope, ColumnContextMenu, I18n, QueryService, WorkPackagesTableHelper, WorkPackagesTableService) {
$scope.I18n = I18n;
$scope.isGroupable = WorkPackagesTableService.isGroupable($scope.column);
// context menu actions
$scope.groupBy = function(columnName) {
QueryService.getQuery().groupBy = columnName;
};
$scope.sortAscending = function(columnName) {
WorkPackagesTableService.sortBy(columnName, 'asc');
};
$scope.sortDescending = function(columnName) {
WorkPackagesTableService.sortBy(columnName, 'desc');
};
$scope.moveLeft = function(columnName) {
WorkPackagesTableHelper.moveColumnBy($scope.columns, columnName, -1);
};
$scope.moveRight = function(columnName) {
WorkPackagesTableHelper.moveColumnBy($scope.columns, columnName, 1);
};
$scope.hideColumn = function(columnName) {
ColumnContextMenu.close();
QueryService.hideColumns(new Array(columnName));
};
}]);