mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-26 05:26:17 +00:00
First code for #658
This commit is contained in:
@@ -23,7 +23,6 @@ $(document).ready(function () {
|
||||
updateForm();
|
||||
updateLayout();
|
||||
updateDescription();
|
||||
updateNativeCurrency();
|
||||
|
||||
|
||||
// when user changes source account or destination, native currency may be different.
|
||||
@@ -60,9 +59,15 @@ function getExchangeInstructions() {
|
||||
* There is an input that shows the currency symbol that is native to the selected
|
||||
* acccount. So when the user changes the selected account, the native currency is updated:
|
||||
*/
|
||||
function updateNativeCurrency() {
|
||||
var newAccountId = getAccountId();
|
||||
var nativeCurrencyId = accountInfo[newAccountId].preferredCurrency;
|
||||
function updateNativeCurrency(useAccountCurrency) {
|
||||
var nativeCurrencyId;
|
||||
if (useAccountCurrency) {
|
||||
var newAccountId = getAccountId();
|
||||
nativeCurrencyId = accountInfo[newAccountId].preferredCurrency;
|
||||
}
|
||||
if (!useAccountCurrency) {
|
||||
nativeCurrencyId = overruleCurrency;
|
||||
}
|
||||
|
||||
$('.currency-option[data-id="' + nativeCurrencyId + '"]').click();
|
||||
$('[data-toggle="dropdown"]').parent().removeClass('open');
|
||||
@@ -180,7 +185,9 @@ function updateForm() {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
updateNativeCurrency();
|
||||
// get instructions all the time.
|
||||
updateNativeCurrency(useAccountCurrency);
|
||||
selectsForeignCurrency();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user