Some more cleaning up and fixing

This commit is contained in:
James Cole
2015-05-15 21:01:24 +02:00
parent aede03d8b2
commit aae003be33
11 changed files with 164 additions and 171 deletions

View File

@@ -5,16 +5,14 @@ if (typeof(google) != 'undefined') {
function drawChart() {
googleColumnChart('chart/reports/income-expenses/' + year, 'income-expenses-chart');
googleColumnChart('chart/reports/income-expenses-sum/' + year, 'income-expenses-sum-chart')
googleColumnChart('chart/reports/income-expenses/' + year + shared, 'income-expenses-chart');
googleColumnChart('chart/reports/income-expenses-sum/' + year + shared, 'income-expenses-sum-chart')
googleStackedColumnChart('chart/budgets/spending/' + year, 'budgets');
googleStackedColumnChart('chart/budgets/spending/' + year + shared, 'budgets');
}
$(function () {
$('.openModal').on('click', openModal);
includeSharedToggle();
$('#includeShared').click(includeSharedSet);
});
function openModal(e) {
@@ -31,32 +29,3 @@ function openModal(e) {
return false;
}
function includeSharedToggle() {
// get setting from JSON.
$.getJSON('json/show-shared-reports').success(function (data) {
console.log('GO');
if (data.value == true) {
// show shared data, update button:
//<i class="state-icon glyphicon glyphicon-check"></i>
$('#includeShared').empty().addClass('btn-info').append($('<i>').addClass('state-icon glyphicon glyphicon-check')).append(' Include shared asset accounts').show();
console.log('true');
} else {
$('#includeShared').empty().removeClass('btn-info').append($('<i>').addClass('state-icon glyphicon glyphicon-unchecked')).append(' Include shared asset accounts').show();
console.log('false');
}
}).fail(function () {
console.log('fail');
});
}
function includeSharedSet() {
// get setting from JSON.
$.getJSON('json/show-shared-reports/set').success(function (data) {
console.log('Value is now: ' + data.value);
includeSharedToggle();
}).fail(function () {
console.log('fail');
});
return false;
}