Skip to content

Commit 5aa4524

Browse files
committed
feat: add collapse all notes button for work view
1 parent 50bcd28 commit 5aa4524

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

app-src/scripts/main/global-services/tasks-s.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,12 @@
680680
}
681681
}
682682
}
683+
684+
collapseNotes(tasks) {
685+
tasks.forEach((task) => {
686+
delete task.showNotes;
687+
});
688+
}
683689
}
684690

685691
// hacky fix for ff

app-src/scripts/work-view/work-view-d.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
77
Estimate remaining: ~<strong ng-bind="vm.totalEstimationRemaining|duration"></strong>
88
<ng-md-icon icon="timer"></ng-md-icon>
9+
10+
<md-button ng-click="vm.collapseNotes()"
11+
class="md-icon-button md-primary">
12+
<ng-md-icon icon="speaker_notes_off"></ng-md-icon>
13+
</md-button>
914
</p>
1015
</header>
1116

app-src/scripts/work-view/work-view-d.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* # workView
66
*/
77

8-
(function () {
8+
(function() {
99
'use strict';
1010

1111
angular
@@ -61,9 +61,14 @@
6161
Dialogs('ADD_TASK', undefined, true);
6262
};
6363

64+
vm.collapseNotes = () => {
65+
Tasks.collapseNotes(vm.tasksDone);
66+
Tasks.collapseNotes(vm.tasksUndone);
67+
};
68+
6469
vm.onTaskDoneChangedUndoneList = (task) => {
6570
if (task.isDone) {
66-
const taskIndex = _.findIndex(vm.tasksUndone, function (taskInArray) {
71+
const taskIndex = _.findIndex(vm.tasksUndone, function(taskInArray) {
6772
return taskInArray.id === task.id;
6873
});
6974
// add to the end of the done task list
@@ -75,7 +80,7 @@
7580

7681
vm.onTaskDoneChangedDoneList = (task) => {
7782
if (!task.isDone) {
78-
const taskIndex = _.findIndex(vm.tasksDone, function (taskInArray) {
83+
const taskIndex = _.findIndex(vm.tasksDone, function(taskInArray) {
7984
return taskInArray.id === task.id;
8085
});
8186
// add to the start of the undone task list

0 commit comments

Comments
 (0)