summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLV-426 <lv-426@taproot.org.il>2014-12-28 17:29:26 +0200
committerLV-426 <lv-426@taproot.org.il>2014-12-28 17:29:26 +0200
commit88d2640a6673878c321e94fb8e70b3c79fc86ccc (patch)
tree6d8c783f5b144961bb225b333ce8a54db8a63528
parente4be5638c188824e82a5bbd7641a386e2fba39f4 (diff)
rz_mesh hook, depends on backend__maintain_ws_connection, default=false
-rw-r--r--src/client/rz_config.js1
-rw-r--r--src/client/rz_core.js15
2 files changed, 14 insertions, 2 deletions
diff --git a/src/client/rz_config.js b/src/client/rz_config.js
index 322f38ac..2258a77a 100644
--- a/src/client/rz_config.js
+++ b/src/client/rz_config.js
@@ -5,5 +5,6 @@ define(function() {
'rz_server_host': 'rhizi.local',
'rz_server_port': '8080',
'backend_enabled': true,
+ 'backend__maintain_ws_connection': false,
};
});
diff --git a/src/client/rz_core.js b/src/client/rz_core.js
index e3bd2b59..ee42c5c0 100644
--- a/src/client/rz_core.js
+++ b/src/client/rz_core.js
@@ -1,7 +1,7 @@
"use strict"
-define(['jquery', 'd3', 'consts', 'rz_bus', 'util', 'model/graph', 'model/core', 'view/helpers', 'view/view', 'rz_observer', 'view/selection', 'rz_config'],
-function($, d3, consts, rz_bus, util, model_graph, model_core, view_helpers, view, rz_observer, selection, rz_config) {
+define(['jquery', 'd3', 'consts', 'rz_bus', 'util', 'model/graph', 'model/core', 'view/helpers', 'view/view', 'rz_observer', 'view/selection', 'rz_config', 'rz_mesh'],
+function($, d3, consts, rz_bus, util, model_graph, model_core, view_helpers, view, rz_observer, selection, rz_config, rz_mesh) {
var addednodes = [],
vis,
@@ -294,8 +294,19 @@ function init_force_layout(){
.start();
}
+/**
+ * Initialize backend websocket connection - this will have no effect if
+ * rz_config.backend__maintain_ws_connection is set to 'false'
+ */
+function init_ws_connection(){
+ if (true == rz_config.backend__maintain_ws_connection){
+ rz_mesh.init();
+ }
+}
+
initDrawingArea();
init_force_layout();
+init_ws_connection();
/**
* find the visual element counterpart of a given model object. This relies on