1
0
Fork 0

GraphViewer fixed a bug where a broken node was returned if no matching node could be found

This commit is contained in:
Michael Hackstein 2013-11-08 10:18:30 +01:00
parent 2428afddd2
commit b0cf923110
1 changed files with 15 additions and 8 deletions

View File

@ -256,6 +256,19 @@ function ArangoAdapter(nodes, edges, config) {
}); });
}, },
*/ */
insertInitialCallback = function(callback) {
return function (n) {
if (n && n.errorCode) {
callback(n);
return;
}
callback(absAdapter.insertInitialNode(n));
}
},
permanentlyRemoveEdgesOfNode = function (nodeId) { permanentlyRemoveEdgesOfNode = function (nodeId) {
sendQuery(queries.connectedEdges, { sendQuery(queries.connectedEdges, {
id: nodeId id: nodeId
@ -352,10 +365,7 @@ function ArangoAdapter(nodes, edges, config) {
self.loadInitialNode = function(nodeId, callback) { self.loadInitialNode = function(nodeId, callback) {
absAdapter.cleanUp(); absAdapter.cleanUp();
var cb = function(n) { self.loadNode(nodeId, insertInitialCallback(callback));
callback(absAdapter.insertInitialNode(n));
};
self.loadNode(nodeId, cb);
}; };
self.loadNodeFromTreeById = function(nodeId, callback) { self.loadNodeFromTreeById = function(nodeId, callback) {
@ -376,10 +386,7 @@ function ArangoAdapter(nodes, edges, config) {
self.loadInitialNodeByAttributeValue = function(attribute, value, callback) { self.loadInitialNodeByAttributeValue = function(attribute, value, callback) {
absAdapter.cleanUp(); absAdapter.cleanUp();
var cb = function(n) { self.loadNodeFromTreeByAttributeValue(attribute, value, insertInitialCallback(callback));
callback(absAdapter.insertInitialNode(n));
};
self.loadNodeFromTreeByAttributeValue(attribute, value, cb);
}; };
self.requestCentralityChildren = function(nodeId, callback) { self.requestCentralityChildren = function(nodeId, callback) {