Commit 06c0779c authored by Sebastien Robin's avatar Sebastien Robin

gui prototype: rename "selection" with "preference", name "selection" was not appropriate

parent a0755f1f
...@@ -38,9 +38,9 @@ ...@@ -38,9 +38,9 @@
_.each(response.data.element, function(value, key, list) { _.each(response.data.element, function(value, key, list) {
console.log("value", value); console.log("value", value);
var element_id = value.id; var element_id = value.id;
var selection_data = response.data.selection[element_id] || {}; var preference_data = response.data.preference[element_id] || {};
_.each(_.pairs(selection_data), function(selection_value, selection_key, selection_list) { _.each(_.pairs(preference_data), function(preference_value, preference_key, preference_list) {
value[selection_value[0]] = selection_value[1]; value[preference_value[0]] = preference_value[1];
}); });
console.log("going to add newElement", value); console.log("going to add newElement", value);
dream_instance.newElement(value); dream_instance.newElement(value);
......
...@@ -86,13 +86,13 @@ ...@@ -86,13 +86,13 @@
}; };
priv.updateElementCoordinate = function(element_id, x, y) { priv.updateElementCoordinate = function(element_id, x, y) {
var selection = priv.selection_container[element_id] || {}; var preference = priv.preference_container[element_id] || {};
var coordinate = selection.coordinate || {}; var coordinate = preference.coordinate || {};
coordinate.x = x; coordinate.x = x;
coordinate.y = y; coordinate.y = y;
console.log("jsonPlumb, updateElementCoordinate, selection", priv.selection_container); console.log("jsonPlumb, updateElementCoordinate, preference", priv.preference_container);
selection["coordinate"] = coordinate; preference["coordinate"] = coordinate;
priv.selection_container[element_id] = selection; priv.preference_container[element_id] = preference;
priv.onDataChange(); priv.onDataChange();
return coordinate; return coordinate;
}; };
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
}; };
priv.getData = function() { priv.getData = function() {
return {"element": priv.element_container, "selection": priv.selection_container}; return {"element": priv.element_container, "preference": priv.preference_container};
}; };
priv.removeElement = function(element_id) { priv.removeElement = function(element_id) {
...@@ -194,7 +194,7 @@ ...@@ -194,7 +194,7 @@
writable: false, writable: false,
value: function () { value: function () {
priv.element_container = {}; priv.element_container = {};
priv.selection_container = {}; priv.preference_container = {};
priv.initJsPlumb(); priv.initJsPlumb();
priv.initDialog(); priv.initDialog();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment