Skip to content

Commit

Permalink
copy and save button
Browse files Browse the repository at this point in the history
  • Loading branch information
arnold-pichler committed Nov 25, 2024
1 parent 9276bfd commit a17b9c4
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions src/components/TheEntryForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -653,12 +653,26 @@
</v-col>
</v-row>
<v-row no-gutters class="bg-grey-darken-2"
><v-col :cols="dataWindow === 1 ? 12 : 6" class="pa-2">
><v-col :cols="dataWindow === 1 ? 12 : 4" class="pa-2">
<v-btn density="compact" color="red" prepend-icon="mdi-close" block @click.stop="cancelData"
>Abbrechen</v-btn
> </v-col
><v-col cols="6" class="pa-2" v-if="dataWindow === 2">
<v-btn density="compact" color="green" prepend-icon="mdi-check" block @click.stop="saveData"
><v-col cols="4" class="pa-2" v-if="dataWindow === 2">
<v-btn
density="compact"
color="green"
prepend-icon="mdi-check"
block
@click.stop="saveData(true)"
>Kopie Speichern</v-btn
> </v-col
><v-col cols="4" class="pa-2" v-if="dataWindow === 2">
<v-btn
density="compact"
color="green-darken-2"
prepend-icon="mdi-check"
block
@click.stop="saveData(false)"
>Speichern</v-btn
>
</v-col></v-row
Expand Down Expand Up @@ -938,13 +952,13 @@ function FloatTrunc(input) {
return result;
}
async function saveData() {
async function saveData(copy) {
const validated = await entryform.value.validate();
if (!validated.valid) {
return;
}
if (currentSaved.value !== null) {
if (!copy && currentSaved.value !== null) {
savedData.value[currentSaved.value] = { ...entry.value };
} else {
savedData.value.push({ ...entry.value });
Expand Down

0 comments on commit a17b9c4

Please sign in to comment.