Various code clean up.

This commit is contained in:
James Cole
2017-07-23 08:16:11 +02:00
parent 2c00a8353d
commit 8bb7d5de3f
26 changed files with 138 additions and 149 deletions

View File

@@ -7,7 +7,7 @@
*
* See the LICENSE file for details.
*/
/** global: Chart, defaultChartOptions, accounting, defaultPieOptions, noDataForChart */
/** global: Chart, defaultChartOptions, accounting, defaultPieOptions, noDataForChart, noDataForChart */
var allCharts = {};
/*
@@ -240,13 +240,14 @@ function pieChart(URI, container) {
* @param colorData
*/
function drawAChart(URI, container, chartType, options, colorData) {
if ($('#' + container).length === 0) {
var containerObj = $('#' + container);
if (containerObj.length === 0) {
return;
}
$.getJSON(URI).done(function (data) {
$('#' + container).removeClass('general-chart-error');
containerObj.removeClass('general-chart-error');
if (data.labels.length === 0) {
// remove the chart container + parent
var holder = $('#' + container).parent().parent();

View File

@@ -16,7 +16,7 @@ $(function () {
configAccounting(currencySymbol);
// on submit of form, disable any button in form:
$('form.form-horizontal').on('submit',function(e) {
$('form.form-horizontal').on('submit',function() {
$('button[type="submit"]').prop('disabled',true);
});

View File

@@ -24,8 +24,6 @@ function showHelp(e) {
specialPage = '';
}
$('#helpBody').html('<i class="fa fa-refresh fa-spin"></i>');
$('#helpTitle').html('Please hold...');
$('#helpModal').modal('show');
$('#helpTitle').html('Help for this page');
$.getJSON('help/' + encodeURI(route)).done(function (data) {

View File

@@ -60,6 +60,8 @@ function failedJobImport(jqxhr, textStatus, error) {
function reportOnJobImport(data) {
switch (data.status) {
default:
break;
case "configured":
// job is ready. Do not check again, just show the start-box. Hide the rest.
$('.statusbox').hide();
@@ -173,6 +175,7 @@ function updateBar(data) {
bar.removeClass('progress-bar-success').addClass('progress-bar-info');
bar.attr('aria-valuenow', 100);
bar.css('width', '100%');
return true;
}
/**
@@ -214,6 +217,4 @@ function reportOnErrors(data) {
$('#import-status-error-list').append(item);
}
}
return;
}

View File

@@ -6,7 +6,7 @@
* See the LICENSE file for details.
*/
/** global: routeForTour, routeStepsUri, routeForFinishedTour */
/** global: routeForTour, routeStepsUri, routeForFinishedTour, forceDemoOff */
$(function () {
"use strict";

View File

@@ -12,7 +12,6 @@
Some vars as prep for the map:
*/
var map;
var markers = [];
var setTag = false;
var mapOptions = {

View File

@@ -6,7 +6,7 @@
* See the LICENSE file for details.
*/
/** global: currencyInfo, accountInfo, what,Modernizr, title, breadcrumbs, middleCrumbName, button, piggiesLength, txt, middleCrumbUrl,exchangeRateInstructions, convertForeignToNative, convertSourceToDestination, selectsForeignCurrency, accountInfo */
/** global: currencyInfo, overruleCurrency,useAccountCurrency, accountInfo, what,Modernizr, title, breadcrumbs, middleCrumbName, button, piggiesLength, txt, middleCrumbUrl,exchangeRateInstructions, convertForeignToNative, convertSourceToDestination, selectsForeignCurrency, accountInfo */
$(document).ready(function () {
"use strict";