mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 22:21:42 +00:00
Some code cleanup.
This commit is contained in:
@@ -69,13 +69,13 @@ function updateBudgetedAmounts(e) {
|
||||
var spentAmount = parseFloat(spentCell.data('spent'));
|
||||
var newAmountLeft = spentAmount + parseFloat(value);
|
||||
var amountLeftString = accounting.formatMoney(newAmountLeft);
|
||||
if(newAmountLeft < 0) {
|
||||
if (newAmountLeft < 0) {
|
||||
leftCell.html('<span class="text-danger">' + amountLeftString + '</span>');
|
||||
}
|
||||
if(newAmountLeft > 0) {
|
||||
if (newAmountLeft > 0) {
|
||||
leftCell.html('<span class="text-success">' + amountLeftString + '</span>');
|
||||
}
|
||||
if(newAmountLeft === 0.0) {
|
||||
if (newAmountLeft === 0.0) {
|
||||
leftCell.html('<span style="color:#999">' + amountLeftString + '</span>');
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,4 @@ $(function () {
|
||||
pieChart(expenseExpenseUri, 'budget-expense-out');
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
@@ -122,7 +122,7 @@ function convertForeignToNative() {
|
||||
function updateNativeAmount(data) {
|
||||
// if native amount is already filled in, even though we do this for the first time:
|
||||
// don't overrule it.
|
||||
if(countConversions === 0 && $('#ffInput_native_amount').val().length > 0) {
|
||||
if (countConversions === 0 && $('#ffInput_native_amount').val().length > 0) {
|
||||
countConversions++;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ $(document).ready(function () {
|
||||
$('#ffInput_amount').on('change', convertForeignToNative);
|
||||
|
||||
// respond to transfer changes:
|
||||
$('#ffInput_source_account_id').on('change',validateCurrencyForTransfer);
|
||||
$('#ffInput_destination_account_id').on('change',validateCurrencyForTransfer);
|
||||
$('#ffInput_source_account_id').on('change', validateCurrencyForTransfer);
|
||||
$('#ffInput_destination_account_id').on('change', validateCurrencyForTransfer);
|
||||
|
||||
// convert source currency to destination currency (slightly different routine for transfers)
|
||||
$('#ffInput_source_amount').on('change', convertSourceToDestination);
|
||||
@@ -64,7 +64,6 @@ function updateInitialPage() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get accountID based on some meta info.
|
||||
*/
|
||||
|
||||
@@ -139,10 +139,10 @@ function resetDivSplits() {
|
||||
row.attr('data-split', i);
|
||||
|
||||
// add or remove class with bg thing
|
||||
if(i % 2 === 0) {
|
||||
if (i % 2 === 0) {
|
||||
row.removeClass('bg-gray-light');
|
||||
}
|
||||
if(i % 2 === 1) {
|
||||
if (i % 2 === 1) {
|
||||
row.addClass('bg-gray-light');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user