mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-03 19:16:51 +00:00
Make sure edit of liability always works.
This commit is contained in:
16
public/v1/js/ff/accounts/edit.js
vendored
16
public/v1/js/ff/accounts/edit.js
vendored
@@ -30,5 +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