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 @@
_.each(response.data.element, function(value, key, list) {
console.log("value", value);
var element_id = value.id;
var selection_data = response.data.selection[element_id] || {};
_.each(_.pairs(selection_data), function(selection_value, selection_key, selection_list) {
value[selection_value[0]] = selection_value[1];
var preference_data = response.data.preference[element_id] || {};
_.each(_.pairs(preference_data), function(preference_value, preference_key, preference_list) {
value[preference_value[0]] = preference_value[1];
});
console.log("going to add newElement", value);
dream_instance.newElement(value);
......
......@@ -86,13 +86,13 @@
};
priv.updateElementCoordinate = function(element_id, x, y) {
var selection = priv.selection_container[element_id] || {};
var coordinate = selection.coordinate || {};
var preference = priv.preference_container[element_id] || {};
var coordinate = preference.coordinate || {};
coordinate.x = x;
coordinate.y = y;
console.log("jsonPlumb, updateElementCoordinate, selection", priv.selection_container);
selection["coordinate"] = coordinate;
priv.selection_container[element_id] = selection;
console.log("jsonPlumb, updateElementCoordinate, preference", priv.preference_container);
preference["coordinate"] = coordinate;
priv.preference_container[element_id] = preference;
priv.onDataChange();
return coordinate;
};
......@@ -123,7 +123,7 @@
};
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) {
......@@ -194,7 +194,7 @@
writable: false,
value: function () {
priv.element_container = {};
priv.selection_container = {};
priv.preference_container = {};
priv.initJsPlumb();
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