mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-08-29 01:13:08 +00:00
Better button response in category overview.
This commit is contained in:
@@ -69,6 +69,7 @@ let transactions = function () {
|
|||||||
resetButton: false,
|
resetButton: false,
|
||||||
rulesButton: true,
|
rulesButton: true,
|
||||||
webhooksButton: true,
|
webhooksButton: true,
|
||||||
|
categorySelectVisible: false
|
||||||
},
|
},
|
||||||
|
|
||||||
// form behaviour during transaction
|
// form behaviour during transaction
|
||||||
@@ -343,7 +344,13 @@ let transactions = function () {
|
|||||||
// destination can never be revenue account
|
// destination can never be revenue account
|
||||||
this.filters.destination = ['Expense account', 'Loan', 'Debt', 'Mortgage', 'Asset account'];
|
this.filters.destination = ['Expense account', 'Loan', 'Debt', 'Mortgage', 'Asset account'];
|
||||||
},
|
},
|
||||||
|
keyUpFromCategory(e) {
|
||||||
|
if (e.key === 'Enter' && false === this.formStates.categorySelectVisible) {
|
||||||
|
this.submitTransaction();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.formStates.categorySelectVisible = document.querySelector('input.ac-category').nextSibling.classList.contains('show');
|
||||||
|
},
|
||||||
submitTransaction() {
|
submitTransaction() {
|
||||||
// reset all messages:
|
// reset all messages:
|
||||||
this.notifications.error.show = false;
|
this.notifications.error.show = false;
|
||||||
@@ -422,7 +429,10 @@ let transactions = function () {
|
|||||||
if (this.formStates.returnHereButton) {
|
if (this.formStates.returnHereButton) {
|
||||||
this.notifications.success.show = true;
|
this.notifications.success.show = true;
|
||||||
this.notifications.success.url = 'transactions/show/' + this.groupProperties.id;
|
this.notifications.success.url = 'transactions/show/' + this.groupProperties.id;
|
||||||
this.notifications.success.text = i18next.t('firefly.stored_journal_js', {description: this.groupProperties.title, interpolation: { escapeValue: false }});
|
this.notifications.success.text = i18next.t('firefly.stored_journal_js', {
|
||||||
|
description: this.groupProperties.title,
|
||||||
|
interpolation: {escapeValue: false}
|
||||||
|
});
|
||||||
this.formStates.isSubmitting = false;
|
this.formStates.isSubmitting = false;
|
||||||
// reset group title again
|
// reset group title again
|
||||||
this.groupProperties.title = null;
|
this.groupProperties.title = null;
|
||||||
|
@@ -72,6 +72,7 @@ let transactions = function () {
|
|||||||
resetButton: true,
|
resetButton: true,
|
||||||
rulesButton: true,
|
rulesButton: true,
|
||||||
webhooksButton: true,
|
webhooksButton: true,
|
||||||
|
categorySelectVisible: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
// form behaviour during transaction
|
// form behaviour during transaction
|
||||||
@@ -111,6 +112,14 @@ let transactions = function () {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
keyUpFromCategory(e) {
|
||||||
|
if (e.key === 'Enter' && false === this.formStates.categorySelectVisible) {
|
||||||
|
this.submitTransaction();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.formStates.categorySelectVisible = document.querySelector('input.ac-category').nextSibling.classList.contains('show');
|
||||||
|
},
|
||||||
|
|
||||||
// submit the transaction form.
|
// submit the transaction form.
|
||||||
// TODO pretty much duplicate of create.js
|
// TODO pretty much duplicate of create.js
|
||||||
submitTransaction() {
|
submitTransaction() {
|
||||||
|
@@ -111,12 +111,12 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-end">
|
<div class="col text-end">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
|
<button @click="addSplit()" class="btn btn-secondary"
|
||||||
|
:disabled="formStates.isSubmitting">{{ __('firefly.add_another_split') }}</button>
|
||||||
<template x-if="1 !== entries.length">
|
<template x-if="1 !== entries.length">
|
||||||
<button :disabled="formStates.isSubmitting" class="btn btn-danger text-white"
|
<button :disabled="formStates.isSubmitting" class="btn btn-danger text-white"
|
||||||
@click="removeSplit(index)">{{ __('firefly.transaction_remove_split') }}</button>
|
@click="removeSplit(index)">{{ __('firefly.transaction_remove_split') }}</button>
|
||||||
</template>
|
</template>
|
||||||
<button @click="addSplit()" class="btn btn-info"
|
|
||||||
:disabled="formStates.isSubmitting">{{ __('firefly.add_another_split') }}</button>
|
|
||||||
<button class="btn btn-success text-white" :disabled="formStates.isSubmitting"
|
<button class="btn btn-success text-white" :disabled="formStates.isSubmitting"
|
||||||
@click="submitTransaction()">{{ __('firefly.submit') }}</button>
|
@click="submitTransaction()">{{ __('firefly.submit') }}</button>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
<input type="search"
|
<input type="search"
|
||||||
class="form-control ac-category"
|
class="form-control ac-category"
|
||||||
:id="'category_name_' + index"
|
:id="'category_name_' + index"
|
||||||
@keyup.enter="submitTransaction()"
|
@keyup="keyUpFromCategory"
|
||||||
x-model="transaction.category_name"
|
x-model="transaction.category_name"
|
||||||
:data-index="index"
|
:data-index="index"
|
||||||
placeholder="{{ __('firefly.category') }}">
|
placeholder="{{ __('firefly.category') }}">
|
||||||
|
Reference in New Issue
Block a user