mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Also in create form.
This commit is contained in:
17
public/v1/js/ff/accounts/create.js
vendored
17
public/v1/js/ff/accounts/create.js
vendored
@@ -30,4 +30,21 @@ $(document).ready(function () {
|
||||
}
|
||||
);
|
||||
}
|
||||
// change the 'ffInput_opening_balance' text based on the
|
||||
// selection of the direction.
|
||||
$("#ffInput_liability_direction").change(triggerDirection);
|
||||
triggerDirection();
|
||||
});
|
||||
|
||||
|
||||
function triggerDirection() {
|
||||
let obj = $("#ffInput_liability_direction");
|
||||
let direction = obj.val();
|
||||
console.log('Direction is now ' + direction);
|
||||
if('credit' === direction) {
|
||||
$('label[for="ffInput_opening_balance"]').text(iAmOwed);
|
||||
}
|
||||
if('debit' === direction) {
|
||||
$('label[for="ffInput_opening_balance"]').text(iOwe);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user