Merge pull request 'Fix input on mobile' (#44) from mobile-input into master
All checks were successful
continuous-integration/drone/push Build is passing

Reviewed-on: #44
This commit is contained in:
Jan Bader 2022-03-15 22:12:31 +01:00
commit 8eabf3d1c8
3 changed files with 19 additions and 10 deletions

View File

@ -47,8 +47,14 @@ const payload = computed(() => JSON.stringify({
const transactionsStore = useTransactionsStore(); const transactionsStore = useTransactionsStore();
function saveTransaction(e: MouseEvent) { function saveTransaction(e: MouseEvent) {
e.preventDefault(); e.preventDefault();
Save();
}
function Save() {
transactionsStore.saveTransaction(payload.value); transactionsStore.saveTransaction(payload.value);
} }
defineExpose({Save});
</script> </script>
<template> <template>

View File

@ -47,15 +47,11 @@ function getStatusSymbol() {
</script> </script>
<template> <template>
<tr <tr v-if="dateChanged()" class="table-row md:hidden">
v-if="dateChanged()" <td class="py-2" colspan="5">
class="table-row md:hidden" <span class="bg-gray-400 dark:bg-slate-600 rounded-lg p-1 px-2 w-full block">
> {{ formatDate(TX.Date) }}
<td </span>
class="bg-gray-200 dark:bg-gray-800 rounded-lg p-2"
colspan="5"
>
{{ formatDate(TX.Date) }}
</td> </td>
</tr> </tr>
<tr <tr

View File

@ -16,6 +16,12 @@ defineProps<{
accountid: string accountid: string
}>() }>()
const modalInputRow = ref<typeof TransactionInputRow | null>(null);
function submitModal() {
modalInputRow.value!.Save();
}
const accounts = useAccountStore(); const accounts = useAccountStore();
const transactions = useTransactionsStore(); const transactions = useTransactionsStore();
const TargetReconcilingBalance = ref(0); const TargetReconcilingBalance = ref(0);
@ -146,7 +152,7 @@ function createReconcilationTransaction() {
/> />
</table> </table>
<div class="md:hidden"> <div class="md:hidden">
<Modal> <Modal @submit="submitModal">
<template #placeholder> <template #placeholder>
<Button <Button
class="fixed right-4 bottom-4 font-bold text-lg bg-blue-500 py-2" class="fixed right-4 bottom-4 font-bold text-lg bg-blue-500 py-2"
@ -155,6 +161,7 @@ function createReconcilationTransaction() {
</Button> </Button>
</template> </template>
<TransactionInputRow <TransactionInputRow
ref="modalInputRow"
class="grid grid-cols-2" class="grid grid-cols-2"
:budgetid="budgetid" :budgetid="budgetid"
:accountid="accountid" :accountid="accountid"