fix: sort out graph events

This commit is contained in:
elaine 2019-05-07 15:47:05 +08:00
parent ee4685ece9
commit 785cb03677

View File

@ -29,6 +29,7 @@ class ItemController {
}
});
}
graph.emit('beforeadditem', { type, model });
if (type === EDGE) {
let source = model.source;
let target = model.target;
@ -60,7 +61,7 @@ class ItemController {
graph.get(type + 's').push(item);
graph.get('itemMap')[item.get('id')] = item;
graph.autoPaint();
graph.emit('aftereadditem', { type, model });
graph.emit('afteradditem', { type, model });
return item;
}
updateItem(item, cfg) {