aboutsummaryrefslogtreecommitdiffstats
path: root/interface/js/app/graph.js
diff options
context:
space:
mode:
authorAlexander Moisseev <moiseev@mezonplus.ru>2017-02-21 11:51:48 +0300
committerAlexander Moisseev <moiseev@mezonplus.ru>2017-02-21 11:51:48 +0300
commit85719f70c71fb5239f1c890bc20984170ada900b (patch)
treeb4d621b9df0f9ed9d238fd18f7d4d4fccae99e84 /interface/js/app/graph.js
parent3480e172837207c3204a62405573250df9a8ef3f (diff)
downloadrspamd-85719f70c71fb5239f1c890bc20984170ada900b.tar.gz
rspamd-85719f70c71fb5239f1c890bc20984170ada900b.zip
[WebUI] Fix graph dataset selector initialization
Diffstat (limited to 'interface/js/app/graph.js')
-rw-r--r--interface/js/app/graph.js43
1 files changed, 20 insertions, 23 deletions
diff --git a/interface/js/app/graph.js b/interface/js/app/graph.js
index 86f7ca352..70a510bc3 100644
--- a/interface/js/app/graph.js
+++ b/interface/js/app/graph.js
@@ -82,12 +82,13 @@ function($, D3Evolution, unused) {
}
};
+ // Get selectors' current state
+ function getSelector(id) {
+ var e = document.getElementById(id);
+ return e.options[e.selectedIndex].value;
+ }
+
function initGraph() {
- // Get selectors' current state
- function getSelector(id) {
- var e = document.getElementById(id);
- return e.options[e.selectedIndex].value;
- }
var graph = new D3Evolution("graph", $.extend({}, graph_options, {
type: getSelector("selType"),
interpolate: getSelector("selInterpolate"),
@@ -148,16 +149,6 @@ function($, D3Evolution, unused) {
});
}
- // Handling mouse events on overlapping elements
- $("#rrd-pie").mouseover(function () {
- $("#rrd-pie").css("z-index", "200");
- $("#rrd-table_toggle").css("z-index", "300");
- });
- $("#rrd-table_toggle").mouseover(function () {
- $("#rrd-pie").css("z-index", "0");
- $("#rrd-table_toggle").css("z-index", "0");
- });
-
var interface = {};
interface.draw = function(rspamd, graphs, neighbours, checked_server, type) {
@@ -180,14 +171,6 @@ function($, D3Evolution, unused) {
graphs.graph = initGraph();
}
- if (type === undefined) {
- function getSelector(id) {
- var e = document.getElementById(id);
- return e.options[e.selectedIndex].value;
- }
- type = getSelector("selData");
- }
-
if (checked_server === "All SERVERS") {
rspamd.queryNeighbours("graph", function (req_data) {
var neighbours_data = req_data
@@ -257,5 +240,19 @@ function($, D3Evolution, unused) {
});
};
+ interface.setup = function() {
+ // Handling mouse events on overlapping elements
+ $("#rrd-pie").mouseover(function () {
+ $("#rrd-pie").css("z-index", "200");
+ $("#rrd-table_toggle").css("z-index", "300");
+ });
+ $("#rrd-table_toggle").mouseover(function () {
+ $("#rrd-pie").css("z-index", "0");
+ $("#rrd-table_toggle").css("z-index", "0");
+ });
+
+ return getSelector("selData");
+ };
+
return interface;
});