diff options
author | Alexander Moisseev <moiseev@mezonplus.ru> | 2018-08-27 19:29:04 +0300 |
---|---|---|
committer | Alexander Moisseev <moiseev@mezonplus.ru> | 2018-08-27 19:29:04 +0300 |
commit | 0ef945420a91e09c89a11831685a9b051051ef5b (patch) | |
tree | 101338de6d0a859469acf7fcb5bfac86473f7422 /interface/js | |
parent | 9c770550de91f4c5075616db57a6f7d3299c072e (diff) | |
download | rspamd-0ef945420a91e09c89a11831685a9b051051ef5b.tar.gz rspamd-0ef945420a91e09c89a11831685a9b051051ef5b.zip |
[Minor] Use loop to destroy graphs and tables
Diffstat (limited to 'interface/js')
-rw-r--r-- | interface/js/app/rspamd.js | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/interface/js/app/rspamd.js b/interface/js/app/rspamd.js index 5472dc284..4cfc99954 100644 --- a/interface/js/app/rspamd.js +++ b/interface/js/app/rspamd.js @@ -53,30 +53,12 @@ function ($, d3pie, visibility, tab_stat, tab_graph, tab_config, } function disconnect() { - if (graphs.chart) { - graphs.chart.destroy(); - delete graphs.chart; - } - if (graphs.rrd_pie) { - graphs.rrd_pie.destroy(); - delete graphs.rrd_pie; - } - if (graphs.graph) { - graphs.graph.destroy(); - delete graphs.graph; - } - if (tables.history) { - tables.history.destroy(); - delete tables.history; - } - if (tables.errors) { - tables.errors.destroy(); - delete tables.errors; - } - if (tables.symbols) { - tables.symbols.destroy(); - delete tables.symbols; - } + [graphs, tables].forEach(function (o) { + Object.keys(o).forEach(function (key) { + o[key].destroy(); + delete o[key]; + }); + }); stopTimers(); cleanCredentials(); |