mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Some extra code for #1376
This commit is contained in:
parent
84bdd47109
commit
ee5a4caaab
18
public/v1/js/ff/budgets/create.js
vendored
18
public/v1/js/ff/budgets/create.js
vendored
@ -21,4 +21,22 @@
|
||||
$(function () {
|
||||
"use strict";
|
||||
$(".content-wrapper form input:enabled:visible:first").first().focus().select();
|
||||
|
||||
$('#ffInput_auto_budget_type').change(updateAutoBudget);
|
||||
|
||||
function updateAutoBudget() {
|
||||
var value = parseInt($('#ffInput_auto_budget_type').val());
|
||||
if (0 === value) {
|
||||
$('#ffInput_auto_budget_currency_id').prop('disabled', true);
|
||||
$('#ffInput_auto_budget_amount').prop('disabled', true);
|
||||
$('#ffInput_auto_budget_period').prop('disabled', true);
|
||||
return;
|
||||
}
|
||||
$('#ffInput_auto_budget_currency_id').prop('disabled', false);
|
||||
$('#ffInput_auto_budget_amount').prop('disabled', false);
|
||||
$('#ffInput_auto_budget_period').prop('disabled', false);
|
||||
}
|
||||
|
||||
updateAutoBudget();
|
||||
|
||||
});
|
18
public/v1/js/ff/budgets/edit.js
vendored
18
public/v1/js/ff/budgets/edit.js
vendored
@ -21,4 +21,22 @@
|
||||
$(function () {
|
||||
"use strict";
|
||||
$(".content-wrapper form input[type='text']:enabled:visible:first").first().focus();
|
||||
|
||||
$('#ffInput_auto_budget_type').change(updateAutoBudget);
|
||||
|
||||
function updateAutoBudget() {
|
||||
var value = parseInt($('#ffInput_auto_budget_type').val());
|
||||
if (0 === value) {
|
||||
$('#ffInput_auto_budget_currency_id').prop('disabled', true);
|
||||
$('#ffInput_auto_budget_amount').prop('disabled', true);
|
||||
$('#ffInput_auto_budget_period').prop('disabled', true);
|
||||
return;
|
||||
}
|
||||
$('#ffInput_auto_budget_currency_id').prop('disabled', false);
|
||||
$('#ffInput_auto_budget_amount').prop('disabled', false);
|
||||
$('#ffInput_auto_budget_period').prop('disabled', false);
|
||||
}
|
||||
|
||||
updateAutoBudget();
|
||||
|
||||
});
|
@ -150,7 +150,7 @@
|
||||
<select class="form-control input-sm" name="budget_id[{{ journal.transaction_journal_id }}]">
|
||||
<option value="0" label="({{ 'no_budget'|_ }})"
|
||||
{% if journal.budget_id == 0 %}selected="selected"{% endif %}
|
||||
>({{ 'no_budget'|_ }})
|
||||
>{{ 'no_budget'|_ }}
|
||||
</option>
|
||||
{% for budget in budgets %}
|
||||
<option value="{{ budget.id }}"{% if budget.id == journal.budget_id %} selected="selected"{% endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user