summaryrefslogtreecommitdiff
path: root/src/client/model
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-07-30 12:28:04 +0300
committerAlon Levy <alon@pobox.com>2015-07-30 18:05:06 +0300
commit09a999fdabf1f415f8a33b318ccd3551e41654d3 (patch)
tree5b729ef6e0e9d0a018db22f4147bc22fefdf042d /src/client/model
parent100b384a4aa88a469e27ff4d404b7266f9e3b9af (diff)
client: node position storing: change key format to use underscores, more cypher friendly
Diffstat (limited to 'src/client/model')
-rw-r--r--src/client/model/graph.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/client/model/graph.js b/src/client/model/graph.js
index 2c2bd89a..a6f4f3a4 100644
--- a/src/client/model/graph.js
+++ b/src/client/model/graph.js
@@ -631,14 +631,24 @@ function Graph(spec) {
rz_api_backend.commit_diff__attr(attr_diff, on_ajax_success, on_ajax_error);
};
+ function layout_x_key(layout_name) {
+ return 'layouts_' + layout_name + '_x';
+ }
+ this.layout_x_key = layout_x_key;
+
+ function layout_y_key(layout_name) {
+ return 'layouts_' + layout_name + '_y';
+ }
+ this.layout_y_key = layout_y_key;
+
/**
* Do an attribute commit with x, y for the current layout
*/
this.nodes__update_positions = function(layout_name) {
// TODO: fix when attribute diff supports nested keys to use:
// layout.<layout_name>.{x,y}
- var x_key = 'layouts.' + layout_name + '.x',
- y_key = 'layouts.' + layout_name + '.y';
+ var x_key = layout_x_key(layout_name),
+ y_key = layout_y_key(layout_name);
// commit x, y to layout
_.values(id_to_node_map).forEach(function (node) {