From 3a32501064badab420a272132570a9dc06f50bd2 Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 21 Jul 2022 16:17:24 +0200 Subject: [PATCH] feat: create task when pressing the button --- src/components/tasks/gantt-chart.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/tasks/gantt-chart.vue b/src/components/tasks/gantt-chart.vue index 056d71dc..861ed574 100644 --- a/src/components/tasks/gantt-chart.vue +++ b/src/components/tasks/gantt-chart.vue @@ -46,7 +46,7 @@ v-model="newTaskTitle" /> - + {{ $t('task.new') }} @@ -195,13 +195,15 @@ const newTaskFieldActive = ref(false) const newTaskTitleField = ref() const newTaskTitle = ref('') -function showCreateNewTask() { +function showCreateTaskOrCreate() { if (!newTaskFieldActive.value) { // Timeout to not send the form if the field isn't even shown setTimeout(() => { newTaskFieldActive.value = true nextTick(() => newTaskTitleField.value.focus()) }, 100) + } else { + createTask() } }