/* globals google, startDate ,reportURL, endDate , reportType ,accountIds , picker:true, minDate, expenseRestShow:true, incomeRestShow:true, year, month, hideTheRest, showTheRest, showTheRestExpense, hideTheRestExpense, columnChart, lineChart, stackedColumnChart */ $(function () { "use strict"; drawChart(); // click open the top X income list: $('#showIncomes').click(showIncomes); // click open the top X expense list: $('#showExpenses').click(showExpenses); }); function drawChart() { "use strict"; // month view: // draw account chart lineChart('/chart/account/report/' + reportType + '/' + startDate + '/' + endDate + '/' + accountIds, 'account-balances-chart'); } function showIncomes() { "use strict"; if (incomeRestShow) { // hide everything, make button say "show" $('#showIncomes').text(showTheRest); $('.incomesCollapsed').removeClass('in').addClass('out'); // toggle: incomeRestShow = false; } else { // show everything, make button say "hide". $('#showIncomes').text(hideTheRest); $('.incomesCollapsed').removeClass('out').addClass('in'); // toggle: incomeRestShow = true; } return false; } function showExpenses() { "use strict"; if (expenseRestShow) { // hide everything, make button say "show" $('#showExpenses').text(showTheRestExpense); $('.expenseCollapsed').removeClass('in').addClass('out'); // toggle: expenseRestShow = false; } else { // show everything, make button say "hide". $('#showExpenses').text(hideTheRestExpense); $('.expenseCollapsed').removeClass('out').addClass('in'); // toggle: expenseRestShow = true; } return false; }