dmn-js-decision-table
Version:
A decision table view for dmn-js
20 lines (19 loc) • 598 B
JavaScript
const COMMANDS = ['row.add', 'row.remove', 'col.add', 'col.remove'];
export default class ContextMenuCloseBehavior {
constructor(contextMenu, eventBus) {
eventBus.on('commandStack.executed', ({
command
}) => {
// close on certain modeling operations
if (COMMANDS.indexOf(command) !== -1) {
contextMenu.close();
}
});
// always close on undo
eventBus.on('commandStack.reverted', () => {
contextMenu.close();
});
}
}
ContextMenuCloseBehavior.$inject = ['contextMenu', 'eventBus'];
//# sourceMappingURL=ContextMenuCloseBehavior.js.map