mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-07 06:31:22 +00:00
Clean up code after changing routes.
This commit is contained in:
4
public/js/ff/categories/show-by-date.js
Normal file
4
public/js/ff/categories/show-by-date.js
Normal file
@@ -0,0 +1,4 @@
|
||||
$(function () {
|
||||
"use strict";
|
||||
columnChart(specific, 'period-specific-period');
|
||||
});
|
||||
@@ -1,19 +1,5 @@
|
||||
/* globals $, categoryID, columnChart, categoryDate */
|
||||
$(function () {
|
||||
"use strict";
|
||||
if (typeof categoryID !== 'undefined') {
|
||||
// more splits:
|
||||
if ($('#all').length > 0) {
|
||||
columnChart('chart/category/' + categoryID + '/all', 'all');
|
||||
}
|
||||
if ($('#period').length > 0) {
|
||||
columnChart('chart/category/' + categoryID + '/period', 'period');
|
||||
}
|
||||
|
||||
}
|
||||
if (typeof categoryID !== 'undefined' && typeof categoryDate !== 'undefined') {
|
||||
columnChart('chart/category/' + categoryID + '/period/' + categoryDate, 'period-specific-period');
|
||||
}
|
||||
|
||||
|
||||
columnChart(all, 'all');
|
||||
columnChart(current, 'period');
|
||||
});
|
||||
@@ -1,19 +0,0 @@
|
||||
/* globals $, categoryID, columnChart, categoryDate */
|
||||
$(function () {
|
||||
"use strict";
|
||||
if (typeof categoryID !== 'undefined') {
|
||||
// more splits:
|
||||
if ($('#all').length > 0) {
|
||||
columnChart('chart/category/' + categoryID + '/all', 'all');
|
||||
}
|
||||
if ($('#period').length > 0) {
|
||||
columnChart('chart/category/' + categoryID + '/period', 'period');
|
||||
}
|
||||
|
||||
}
|
||||
if (typeof categoryID !== 'undefined' && typeof categoryDate !== undefined) {
|
||||
columnChart('chart/category/' + categoryID + '/period/' + categoryDate, 'period-specific-period');
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
@@ -8,31 +8,25 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
// it's hard coded, but what you're gonna do?
|
||||
var catInUri = 'chart/category/' + accountIds + '/' + categoryIds + '/' + startDate + '/' + endDate + '/OTHERS/income';
|
||||
var catOutUri = 'chart/category/' + accountIds + '/' + categoryIds + '/' + startDate + '/' + endDate + '/OTHERS/expense';
|
||||
var accInUri = 'chart/account/' + accountIds + '/' + categoryIds + '/' + startDate + '/' + endDate + '/OTHERS/income';
|
||||
var accOutUri = 'chart/account/' + accountIds + '/' + categoryIds + '/' + startDate + '/' + endDate + '/OTHERS/expense';
|
||||
|
||||
|
||||
$(function () {
|
||||
"use strict";
|
||||
drawChart();
|
||||
|
||||
$('#categories-in-pie-chart-checked').on('change', function () {
|
||||
redrawPieChart('categories-in-pie-chart', catInUri);
|
||||
redrawPieChart('categories-in-pie-chart', categoryIncomeUri);
|
||||
});
|
||||
|
||||
$('#categories-out-pie-chart-checked').on('change', function () {
|
||||
redrawPieChart('categories-out-pie-chart', catOutUri);
|
||||
redrawPieChart('categories-out-pie-chart', categoryExpenseUri);
|
||||
});
|
||||
|
||||
$('#accounts-in-pie-chart-checked').on('change', function () {
|
||||
redrawPieChart('accounts-in-pie-chart', accInUri);
|
||||
redrawPieChart('accounts-in-pie-chart', accountIncomeUri);
|
||||
});
|
||||
|
||||
$('#accounts-out-pie-chart-checked').on('change', function () {
|
||||
redrawPieChart('accounts-out-pie-chart', accOutUri);
|
||||
redrawPieChart('accounts-out-pie-chart', accountExpenseUri);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -42,13 +36,13 @@ function drawChart() {
|
||||
"use strict";
|
||||
|
||||
// month view:
|
||||
stackedColumnChart('chart/category-report-in-out/' + accountIds + '/' + categoryIds + '/' + startDate + '/' + endDate, 'in-out-chart');
|
||||
stackedColumnChart(mainUri, 'in-out-chart');
|
||||
|
||||
// draw pie chart of income, depending on "show other transactions too":
|
||||
redrawPieChart('categories-in-pie-chart', catInUri);
|
||||
redrawPieChart('categories-out-pie-chart', catOutUri);
|
||||
redrawPieChart('accounts-in-pie-chart', accInUri);
|
||||
redrawPieChart('accounts-out-pie-chart', accOutUri);
|
||||
redrawPieChart('categories-in-pie-chart', categoryIncomeUri);
|
||||
redrawPieChart('categories-out-pie-chart', categoryExpenseUri);
|
||||
redrawPieChart('accounts-in-pie-chart', accountIncomeUri);
|
||||
redrawPieChart('accounts-out-pie-chart', accountExpenseUri);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -108,8 +108,7 @@ function clickCategoryChart(e) {
|
||||
var link = $(e.target);
|
||||
var categoryId = link.data('category');
|
||||
|
||||
// this url is different from the one below. this is something that must be fixed
|
||||
var URL = 'chart/category/' + categoryId + '/report-period/' + startDate + '/' + endDate + '/' + accountIds;
|
||||
var URL = 'chart/category/report-period/' + categoryId + '/' + accountIds + '/' + startDate + '/' + endDate;
|
||||
var container = 'category_chart';
|
||||
columnChart(URL, container);
|
||||
return false;
|
||||
|
||||
@@ -5,7 +5,6 @@ $(function () {
|
||||
drawChart();
|
||||
|
||||
loadAjaxPartial('budgetPeriodReport', budgetPeriodReportUri);
|
||||
|
||||
loadAjaxPartial('categoryExpense', categoryExpenseUri);
|
||||
loadAjaxPartial('categoryIncome', categoryIncomeUri);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user