change select all to select all the displayed tasks

This commit is contained in:
MaysWind 2019-04-07 12:31:44 +08:00
parent 561bf4417b
commit e9c3f0fb56
3 changed files with 22 additions and 13 deletions

View file

@ -66,18 +66,6 @@
}, silent); }, silent);
}; };
$scope.filterByTaskName = function (task) {
if (!task || !angular.isString(task.taskName)) {
return false;
}
if (!$rootScope.searchContext || !$rootScope.searchContext.text) {
return true;
}
return (task.taskName.toLowerCase().indexOf($rootScope.searchContext.text.toLowerCase()) >= 0);
};
$scope.getOrderType = function () { $scope.getOrderType = function () {
return ariaNgSettingService.getDisplayOrder(); return ariaNgSettingService.getDisplayOrder();
}; };

View file

@ -139,6 +139,10 @@
for (var i = 0; i < this.list.length; i++) { for (var i = 0; i < this.list.length; i++) {
var task = this.list[i]; var task = this.list[i];
if (!$rootScope.filterTask(task)) {
continue;
}
if (!this.selected[task.gid]) { if (!this.selected[task.gid]) {
isAllSelected = false; isAllSelected = false;
break; break;
@ -160,11 +164,28 @@
for (var i = 0; i < this.list.length; i++) { for (var i = 0; i < this.list.length; i++) {
var task = this.list[i]; var task = this.list[i];
if (!$rootScope.filterTask(task)) {
continue;
}
this.selected[task.gid] = !isAllSelected; this.selected[task.gid] = !isAllSelected;
} }
} }
}; };
$rootScope.filterTask = function (task) {
if (!task || !angular.isString(task.taskName)) {
return false;
}
if (!$rootScope.searchContext || !$rootScope.searchContext.text) {
return true;
}
return (task.taskName.toLowerCase().indexOf($rootScope.searchContext.text.toLowerCase()) >= 0);
};
$rootScope.swipeActions = { $rootScope.swipeActions = {
leftSwipe: function () { leftSwipe: function () {
if (isSidebarShowInSmallScreen()) { if (isSidebarShowInSmallScreen()) {

View file

@ -33,7 +33,7 @@
</div> </div>
</div> </div>
<div class="task-table-body" ng-class="{'draggable': isSupportDragTask()}" dragula="'task-list'" dragula-model="taskContext.list"> <div class="task-table-body" ng-class="{'draggable': isSupportDragTask()}" dragula="'task-list'" dragula-model="taskContext.list">
<div class="row pointer-cursor" ng-repeat="task in taskContext.list | filter: filterByTaskName | taskOrderBy: getOrderType()" <div class="row pointer-cursor" ng-repeat="task in taskContext.list | filter: filterTask | taskOrderBy: getOrderType()"
data-gid="{{task.gid}}" data-selected="{{!!taskContext.selected[task.gid]}}" data-toggle="context" data-target="#task-table-contextmenu" data-gid="{{task.gid}}" data-selected="{{!!taskContext.selected[task.gid]}}" data-toggle="context" data-target="#task-table-contextmenu"
ng-click="taskContext.selected[task.gid] = !taskContext.selected[task.gid]"> ng-click="taskContext.selected[task.gid] = !taskContext.selected[task.gid]">
<div class="col-md-8 col-sm-7 col-xs-12"> <div class="col-md-8 col-sm-7 col-xs-12">