From: Alexander Moisseev Date: Sun, 8 Jul 2018 07:47:56 +0000 (+0300) Subject: [WebUI] Avoid using "undefined" property X-Git-Tag: 1.7.8~21^2~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e514ce57b5dfba541564828ef6373c0912a9f7cd;p=rspamd.git [WebUI] Avoid using "undefined" property of the global object --- diff --git a/.eslintrc.json b/.eslintrc.json index c5f2bc59c..71e2b443d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -78,7 +78,6 @@ "no-redeclare": "off", "no-shadow": "off", "no-undef": "off", - "no-undefined": "off", "no-underscore-dangle": "off", "no-use-before-define": "off", "one-var-declaration-per-line": "off", diff --git a/interface/js/app/graph.js b/interface/js/app/graph.js index de90c4a73..c5fba91b1 100644 --- a/interface/js/app/graph.js +++ b/interface/js/app/graph.js @@ -205,7 +205,7 @@ define(["jquery", "d3evolution", "footable"], drawRrdTable(rrd_summary, unit); } - if (graphs.graph === undefined) { + if (!graphs.graph) { graphs.graph = initGraph(); } diff --git a/interface/js/app/history.js b/interface/js/app/history.js index e89108185..7677550bd 100644 --- a/interface/js/app/history.js +++ b/interface/js/app/history.js @@ -612,7 +612,7 @@ define(["jquery", "footable", "humanize"], }); } else if (ft.history) { ft.history.destroy(); - ft.history = undefined; + delete ft.history; } }); } @@ -676,11 +676,11 @@ define(["jquery", "footable", "humanize"], } if (ft.history) { ft.history.destroy(); - ft.history = undefined; + delete ft.history; } if (ft.errors) { ft.errors.destroy(); - ft.errors = undefined; + delete ft.errors; } if (checked_server === "All SERVERS") { rspamd.queryNeighbours("errors", function () { diff --git a/interface/js/app/rspamd.js b/interface/js/app/rspamd.js index c60c5889d..9b29ffd6d 100644 --- a/interface/js/app/rspamd.js +++ b/interface/js/app/rspamd.js @@ -47,27 +47,27 @@ function ($, d3pie, visibility, tab_stat, tab_graph, tab_config, function disconnect() { if (graphs.chart) { graphs.chart.destroy(); - graphs.chart = undefined; + delete graphs.chart; } if (graphs.rrd_pie) { graphs.rrd_pie.destroy(); - graphs.rrd_pie = undefined; + delete graphs.rrd_pie; } if (graphs.graph) { graphs.graph.destroy(); - graphs.graph = undefined; + delete graphs.graph; } if (tables.history) { tables.history.destroy(); - tables.history = undefined; + delete tables.history; } if (tables.errors) { tables.errors.destroy(); - tables.errors = undefined; + delete tables.errors; } if (tables.symbols) { tables.symbols.destroy(); - tables.symbols = undefined; + delete tables.symbols; } stopTimers();