* @returns {boolean}
*/
ModelGraphEditor.prototype.updateDataNode = function (node, args, success, error) {
- console.log(node)
+ console.log(node);
+ var self = this;
var controller = new TCD3.OsmController();
- controller.updateNode(this,node, args, function(){
-
+ controller.updateNode(this,node, args, function(result){
+ self.updateData(result);
+ success && success();
}, error);
};
* @returns {boolean}
*/
ModelGraphEditor.prototype.updateGraphParams = function (args, success, error) {
+ var self = this;
var controller = new TCD3.OsmController();
- controller.updateGraphParams(args, function(){
-
+ controller.updateGraphParams(args, function(result){
+ self.updateData(result);
+ success && success();
}, error);
};
if (self.model.layer[current_layer].nodes[node_type].removable.callback) {
var c = self.model.callback[self.model.layer[current_layer].nodes[node_type].removable.callback].class;
var controller = new TCD3.OsmController();
- controller[self.model.layer[current_layer].nodes[node_type].removable.callback](self, node, function () {
- self.parent.removeNode.call(self, node);
+ controller[self.model.layer[current_layer].nodes[node_type].removable.callback](self, node, function (result) {
+ self._deselectAllNodes();
+ self.updateData(result);
success && success();
}, error);
} else {
link.directed_edge = direct_edge;
var c = self.model.callback[callback].class;
var controller = new TCD3.OsmController();
- controller[callback](self, link, function () {
+ controller[callback](self, link, function (result) {
self._deselectAllNodes();
- self.parent.addLink.call(self, link);
- if (success)
- success();
+ self.updateData(result);
+ success && success();
}, error);
} else {
log('addLink: callback undefined in model spec.');
var source_type = s.info.type;
var destination_type = d.info.type;
var current_layer = self.getCurrentView();
+ console.log(self.model.layer[current_layer])
if (self.model.layer[current_layer].allowed_edges && self.model.layer[current_layer].allowed_edges[source_type] && self.model.layer[current_layer].allowed_edges[source_type].destination[destination_type] &&
self.model.layer[current_layer].allowed_edges[source_type].destination[destination_type].removable
) {
var callback = self.model.layer[current_layer].allowed_edges[source_type].destination[destination_type].removable.callback;
var c = self.model.callback[callback].class;
var controller = new TCD3.OsmController();
- controller[callback](self, link, function () {
+ controller[callback](self, link, function (result) {
self._deselectAllNodes();
self._deselectAllLinks();
- self.parent.removeLink.call(self, link.index);
+
+ self.updateData(result);
+ // success && success();
success && success();
}, error);
} else {