mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-22 08:56:39 -06:00
Also in create form.
This commit is contained in:
parent
7111aec101
commit
7e6ce7c3e8
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);
|
||||
}
|
||||
}
|
||||
|
@ -84,6 +84,10 @@
|
||||
</form>
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script type="text/javascript" nonce="{{ JS_NONCE }}">
|
||||
var iAmOwed = '{{ 'i_am_owed_amount'|_|escape('js') }}';
|
||||
var iOwe = '{{ 'i_owe_amount'|_|escape('js') }}';
|
||||
</script>
|
||||
<script src="v1/lib/leaflet/leaflet.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
|
||||
<script type="text/javascript" src="v1/js/lib/modernizr-custom.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
|
||||
<script type="text/javascript" src="v1/js/lib/jquery-ui.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
|
||||
|
Loading…
Reference in New Issue
Block a user