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);
};
$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 () {
return ariaNgSettingService.getDisplayOrder();
};

View file

@ -139,6 +139,10 @@
for (var i = 0; i < this.list.length; i++) {
var task = this.list[i];
if (!$rootScope.filterTask(task)) {
continue;
}
if (!this.selected[task.gid]) {
isAllSelected = false;
break;
@ -160,11 +164,28 @@
for (var i = 0; i < this.list.length; i++) {
var task = this.list[i];
if (!$rootScope.filterTask(task)) {
continue;
}
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 = {
leftSwipe: function () {
if (isSidebarShowInSmallScreen()) {

View file

@ -33,7 +33,7 @@
</div>
</div>
<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"
ng-click="taskContext.selected[task.gid] = !taskContext.selected[task.gid]">
<div class="col-md-8 col-sm-7 col-xs-12">