Browse Source

automatically create multiple tasks if seperated by semicolons;

chronos
stingl 3 years ago
parent
commit
0f08919318
  1. 12
      src/views/TasksForTracker.vue

12
src/views/TasksForTracker.vue

@ -83,13 +83,23 @@ export default { @@ -83,13 +83,23 @@ export default {
this.$store.state.selectedTracker.tasks = [];
}
let newTasks = [this.newTaskInput];
if (this.newTaskInput.split(';') > 3) {
newTasks = this.newTaskInput.split(';').reverse().map((task) => {
return task.trim();
})
}
newTasks.forEach((task) => {
this.$store.state.selectedTracker.tasks.pushToBeginning({
name: this.newTaskInput,
name: task,
done: false,
created: moment(),
percentDone: 0,
finished: null
});
})
this.newTaskInput = '';
this.$store.commit('saveTrackers');

Loading…
Cancel
Save