mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-08-04 21:42:44 +00:00
add configurable mov to backlog and move to today keyboard shortcuts #2
This commit is contained in:
parent
513e8580b1
commit
4e1ce2a77f
4 changed files with 36 additions and 0 deletions
|
|
@ -47,6 +47,8 @@
|
|||
taskDelete: 'Delete',
|
||||
selectPreviousTask: 'k',
|
||||
selectNextTask: 'j',
|
||||
moveToBacklog: '',
|
||||
moveToTodaysTasks: ''
|
||||
},
|
||||
config: {
|
||||
isTakeABreakEnabled: false,
|
||||
|
|
|
|||
|
|
@ -496,6 +496,22 @@
|
|||
}
|
||||
}
|
||||
|
||||
moveTask(task, fromArray, toArray) {
|
||||
const index = _.findIndex(fromArray, ['id', task.id]);
|
||||
if (index >= 0) {
|
||||
fromArray.splice(index, 1);
|
||||
toArray.unshift(task);
|
||||
}
|
||||
}
|
||||
|
||||
moveTaskFromBackLogToToday(task) {
|
||||
this.moveTask(task, this.$localStorage.backlogTasks, this.$localStorage.tasks);
|
||||
}
|
||||
|
||||
moveTaskFromTodayToBackLog(task) {
|
||||
this.moveTask(task, this.$localStorage.tasks, this.$localStorage.backlogTasks);
|
||||
}
|
||||
|
||||
addTasksToTopOfBacklog(tasks) {
|
||||
this.$localStorage.backlogTasks = tasks.concat(this.$localStorage.backlogTasks);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,4 +89,16 @@
|
|||
keyboard-key-input
|
||||
ng-model="vm.keys.selectPreviousTask">
|
||||
</md-input-container>
|
||||
<md-input-container class="md-block">
|
||||
<label>Move task to task backlog</label>
|
||||
<input type="text"
|
||||
keyboard-key-input
|
||||
ng-model="vm.keys.moveToBacklog">
|
||||
</md-input-container>
|
||||
<md-input-container class="md-block">
|
||||
<label>Move task to task todays task list</label>
|
||||
<input type="text"
|
||||
keyboard-key-input
|
||||
ng-model="vm.keys.moveToTodaysTasks">
|
||||
</md-input-container>
|
||||
</div>
|
||||
|
|
@ -229,6 +229,12 @@
|
|||
if ($event.key === this.$localStorage.keys.taskAddSubTask) {
|
||||
this.addSubTask(task);
|
||||
}
|
||||
if ($event.key === this.$localStorage.keys.moveToBacklog) {
|
||||
this.Tasks.moveTaskFromTodayToBackLog(task);
|
||||
}
|
||||
if ($event.key === this.$localStorage.keys.moveToTodaysTasks) {
|
||||
this.Tasks.moveTaskFromBackLogToToday(task);
|
||||
}
|
||||
|
||||
if ($event.key === this.$localStorage.keys.taskDelete) {
|
||||
this.deleteTask(task);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue