mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Various small changes.
This commit is contained in:
@@ -102,7 +102,7 @@ function currencySelect(e) {
|
||||
$('#' + spanId).text(symbol);
|
||||
|
||||
// close the menu (hack hack)
|
||||
$('#' + menuID).click();
|
||||
$('#' + menuID).dropdown('toggle');
|
||||
|
||||
|
||||
return false;
|
||||
|
@@ -6,19 +6,16 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
/** global: what,Modernizr, title, breadcrumbs, middleCrumbName, button, piggiesLength, txt, doSwitch, middleCrumbUrl */
|
||||
/** global: what,Modernizr, title, breadcrumbs, middleCrumbName, button, piggiesLength, txt, middleCrumbUrl */
|
||||
|
||||
$(document).ready(function () {
|
||||
"use strict";
|
||||
|
||||
// respond to switch buttons when
|
||||
// creating stuff:
|
||||
if (doSwitch == true) {
|
||||
updateButtons();
|
||||
updateForm();
|
||||
updateLayout();
|
||||
updateDescription();
|
||||
}
|
||||
// respond to switch buttons
|
||||
updateButtons();
|
||||
updateForm();
|
||||
updateLayout();
|
||||
updateDescription();
|
||||
|
||||
if (!Modernizr.inputtypes.date) {
|
||||
$('input[type="date"]').datepicker(
|
||||
@@ -28,11 +25,27 @@ $(document).ready(function () {
|
||||
);
|
||||
}
|
||||
|
||||
// update currency
|
||||
$('select[name="source_account_id"]').on('change', updateCurrency)
|
||||
|
||||
// get JSON things:
|
||||
getJSONautocomplete();
|
||||
|
||||
});
|
||||
|
||||
|
||||
function updateCurrency() {
|
||||
// get value:
|
||||
var accountId = $('select[name="source_account_id"]').val();
|
||||
console.log('account id is ' + accountId);
|
||||
var currencyPreference = accountInfo[accountId].preferredCurrency;
|
||||
console.log('currency pref is ' + currencyPreference);
|
||||
|
||||
$('.currency-option[data-id="' + currencyPreference + '"]').click();
|
||||
$('[data-toggle="dropdown"]').parent().removeClass('open');
|
||||
$('select[name="source_account_id"]').focus();
|
||||
|
||||
}
|
||||
|
||||
function updateDescription() {
|
||||
$.getJSON('json/transaction-journals/' + what).done(function (data) {
|
||||
$('input[name="description"]').typeahead('destroy').typeahead({source: data});
|
||||
|
Reference in New Issue
Block a user