diagram-js
Version:
A toolbox for displaying and modifying diagrams on the web
18 lines (13 loc) • 350 B
JavaScript
export default function ReplaceSelectionBehavior(selection, eventBus) {
eventBus.on('replace.end', 500, function(event) {
const {
newElement,
hints = {}
} = event;
if (hints.select === false) {
return;
}
selection.select(newElement);
});
}
ReplaceSelectionBehavior.$inject = [ 'selection', 'eventBus' ];