mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Better button response in category overview.
This commit is contained in:
parent
bd7fe92818
commit
dcea6b757b
@ -69,6 +69,7 @@ let transactions = function () {
|
||||
resetButton: false,
|
||||
rulesButton: true,
|
||||
webhooksButton: true,
|
||||
categorySelectVisible: false
|
||||
},
|
||||
|
||||
// form behaviour during transaction
|
||||
@ -343,7 +344,13 @@ let transactions = function () {
|
||||
// destination can never be revenue 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() {
|
||||
// reset all messages:
|
||||
this.notifications.error.show = false;
|
||||
@ -422,7 +429,10 @@ let transactions = function () {
|
||||
if (this.formStates.returnHereButton) {
|
||||
this.notifications.success.show = true;
|
||||
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;
|
||||
// reset group title again
|
||||
this.groupProperties.title = null;
|
||||
|
@ -72,6 +72,7 @@ let transactions = function () {
|
||||
resetButton: true,
|
||||
rulesButton: true,
|
||||
webhooksButton: true,
|
||||
categorySelectVisible: false,
|
||||
},
|
||||
|
||||
// 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.
|
||||
// TODO pretty much duplicate of create.js
|
||||
submitTransaction() {
|
||||
|
@ -111,12 +111,12 @@
|
||||
<div class="row">
|
||||
<div class="col text-end">
|
||||
<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">
|
||||
<button :disabled="formStates.isSubmitting" class="btn btn-danger text-white"
|
||||
@click="removeSplit(index)">{{ __('firefly.transaction_remove_split') }}</button>
|
||||
</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"
|
||||
@click="submitTransaction()">{{ __('firefly.submit') }}</button>
|
||||
</div>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<input type="search"
|
||||
class="form-control ac-category"
|
||||
:id="'category_name_' + index"
|
||||
@keyup.enter="submitTransaction()"
|
||||
@keyup="keyUpFromCategory"
|
||||
x-model="transaction.category_name"
|
||||
:data-index="index"
|
||||
placeholder="{{ __('firefly.category') }}">
|
||||
|
Loading…
Reference in New Issue
Block a user