diff options
author | Michal Čihař <mcihar@suse.cz> | 2013-04-15 14:03:11 +0400 |
---|---|---|
committer | Michal Čihař <mcihar@suse.cz> | 2013-04-15 14:03:11 +0400 |
commit | 020a3e1ce401163b6000022a723748721823e67a (patch) | |
tree | 0e403526607d7751d9e2fa1ff0a76076e400e983 /js/tbl_chart.js | |
parent | 4f31f7fa1e6137204e502119d2890bca0d01d9c6 (diff) |
Use type cast safe comparison
The values like true, '' or 0 could compare to lot of other stuff with
type casting.
Diffstat (limited to 'js/tbl_chart.js')
-rw-r--r-- | js/tbl_chart.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/js/tbl_chart.js b/js/tbl_chart.js index dc292fd3f9..de1099397c 100644 --- a/js/tbl_chart.js +++ b/js/tbl_chart.js @@ -78,7 +78,7 @@ AJAX.registerOnload('tbl_chart.js', function() { temp_chart_title = $(this).val(); }).keyup(function() { var title = $(this).val(); - if (title.length == 0) { + if (title.length === 0) { title = ' '; } currentSettings.title = $('input[name="chartTitle"]').val(); @@ -166,7 +166,7 @@ $("#tblchartform").live('submit', function(event) { PMA_prepareForAjaxRequest($form); $.post($form.attr('action'), $form.serialize(), function(data) { - if (data.success == true) { + if (data.success === true) { $('.success').fadeOut(); if (typeof data.chartData != 'undefined') { chart_data = jQuery.parseJSON(data.chartData); @@ -223,7 +223,7 @@ function extractDate(dateString) { var matches, match; var dateTimeRegExp = /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/; var dateRegExp = /[0-9]{4}-[0-9]{2}-[0-9]{2}/; - + matches = dateTimeRegExp.exec(dateString); if (matches != null && matches.length > 0) { match = matches[0]; @@ -239,7 +239,7 @@ function extractDate(dateString) { } function PMA_queryChart(data, columnNames, settings) { - if ($('#querychart').length == 0) { + if ($('#querychart').length === 0) { return; } @@ -300,7 +300,7 @@ function PMA_queryChart(data, columnNames, settings) { newRow = []; for ( var j = 0; j < columnsToExtract.length; j++) { col = columnNames[columnsToExtract[j]]; - if (j == 0) { + if (j === 0) { if (settings.type == 'timeline') { // first column is date type newRow.push(extractDate(row[col])); } else { // first column is string type |