]> source.dussan.org Git - rspamd.git/commitdiff
[WebUI] Avoid using "undefined" property
authorAlexander Moisseev <moiseev@mezonplus.ru>
Sun, 8 Jul 2018 07:47:56 +0000 (10:47 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Sun, 8 Jul 2018 07:47:56 +0000 (10:47 +0300)
of the global object

.eslintrc.json
interface/js/app/graph.js
interface/js/app/history.js
interface/js/app/rspamd.js

index c5f2bc59cacb9533c9a5ff2bb6b2761199fc2f87..71e2b443d1d3ccb4ae1d5edbd95155232fefcf24 100644 (file)
@@ -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",
index de90c4a7321f3858f79d47f796052c1835b4ae39..c5fba91b12f9b9f42cdb686d47a093abf0f66920 100644 (file)
@@ -205,7 +205,7 @@ define(["jquery", "d3evolution", "footable"],
                 drawRrdTable(rrd_summary, unit);
             }
 
-            if (graphs.graph === undefined) {
+            if (!graphs.graph) {
                 graphs.graph = initGraph();
             }
 
index e8910818577e009cb58950f1f392870652c64e3d..7677550bd2afc110195b89af90418b10ec55a13c 100644 (file)
@@ -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 () {
index c60c5889d10055c7d99c9403443e99d5167f4e2a..9b29ffd6dec7e9d0c52eb1abeef349cc6f699014 100644 (file)
@@ -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();