From 4fa9977d90ca9b804a3dec863f8589b565235292 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 24 Jun 2013 18:13:14 -0700 Subject: [PATCH] CRM-12887 simplify code ---------------------------------------- * CRM-12887: Js tidy-up on Contribution dashboard http://issues.civicrm.org/jira/browse/CRM-12887 --- templates/CRM/Contribute/Page/DashBoard.js | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/templates/CRM/Contribute/Page/DashBoard.js b/templates/CRM/Contribute/Page/DashBoard.js index e1a37f3314..2564089198 100644 --- a/templates/CRM/Contribute/Page/DashBoard.js +++ b/templates/CRM/Contribute/Page/DashBoard.js @@ -1,26 +1,14 @@ // http://civicrm.org/licensing -//http://wiki.civicrm.org/confluence/display/CRMDOC43/Javascript+Reference /*jslint indent: 2 */ /*global CRM, cj */ cj(function ($) { 'use strict'; function getChart() { - var year, charttype, date, currentYear, chartUrl; - year = $('#select_year').val(); - charttype = $('#chart_type').val(); - date = new Date(); - currentYear = date.getFullYear(); - if (!charttype) { - charttype = 'bvg'; - } - if (!year) { - year = currentYear; - } - chartUrl = CRM.url("civicrm/ajax/chart", { + var chartUrl = CRM.url("civicrm/ajax/chart", { 'snippet': 4, - 'year': year, - 'type': charttype + 'year': $('#select_year').val() || new Date().getFullYear(), + 'type': $('#chart_type').val() || 'bvg' }); $("#chartData").load(chartUrl, function() { $("select", "#chartData").change(getChart); -- 2.25.1