This commit is contained in:
James Cole 2019-09-08 20:11:00 +02:00
parent 5623bb20ee
commit 2de79ea392
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -183,51 +183,55 @@ function initializeButtons() {
function updateFormFields() { function updateFormFields() {
if (transactionType === 'withdrawal') { if (transactionType === 'withdrawal') {
// hide source account name: // hide source ID for deposits
// $('#source_name_holder').hide(); // no longer used
$('#deposit_source_id_holder').hide(); $('#deposit_source_id_holder').hide();
// show source account ID: // show source ID for other transaction types
$('#source_id_holder').show(); $('#source_id_holder').show();
// show destination name: // show destination ID for withdrawal:
// $('#destination_name_holder').show(); // no longer used.
$('#withdrawal_destination_id_holder').show(); $('#withdrawal_destination_id_holder').show();
// hide destination ID: // hide destination ID for other types
$('#destination_id_holder').hide(); $('#destination_id_holder').hide();
// show budget // show budget
$('#budget_id_holder').show(); $('#budget_id_holder').show();
// hide piggy bank:
$('#piggy_bank_id_holder').hide(); $('#piggy_bank_id_holder').hide();
} }
if (transactionType === 'deposit') { if (transactionType === 'deposit') {
// $('#source_name_holder').show(); // no longer used // show source ID for deposits
$('#deposit_source_id_holder').show(); $('#deposit_source_id_holder').show();
// hide source ID for other transaction types
$('#source_id_holder').hide(); $('#source_id_holder').hide();
// $('#destination_name_holder').hide(); // no longer used // hide destination ID for withdrawal:
$('#withdrawal_destination_id_holder').hide(); $('#withdrawal_destination_id_holder').hide();
// show destination ID for other types:
$('#destination_id_holder').show(); $('#destination_id_holder').show();
// the rest
$('#budget_id_holder').hide(); $('#budget_id_holder').hide();
$('#piggy_bank_id_holder').hide(); $('#piggy_bank_id_holder').hide();
} }
if (transactionType === 'transfer') { if (transactionType === 'transfer') {
// $('#source_name_holder').hide(); // no longer used // hide source ID for deposits
$('#deposit_source_id_holder').hide(); $('#deposit_source_id_holder').hide();
// show source ID for others
$('#source_id_holder').show(); $('#source_id_holder').show();
// $('#destination_name_holder').hide(); // no longer used // hide destination ID for withdrawal
$('#withdrawal_destination_id_holder').show(); $('#withdrawal_destination_id_holder').hide();
// show destination ID for others
$('#destination_id_holder').show(); $('#destination_id_holder').show();
// the rest
$('#budget_id_holder').hide(); $('#budget_id_holder').hide();
$('#piggy_bank_id_holder').show(); $('#piggy_bank_id_holder').show();
} }