forked from moon-studio/vite-vue-bpmn-process
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
31 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type EventBus from 'diagram-js/lib/core/EventBus' | ||
import type CommandStack from 'diagram-js/lib/command/CommandStack' | ||
import type CommandHandler from 'diagram-js/lib/command/CommandHandler' | ||
import MultiCommandHandler from './MultiCommandHandler' | ||
|
||
const HANDLERS: Record<string, CommandHandler> = { | ||
'panel.multi-command': MultiCommandHandler | ||
} | ||
|
||
export default class CommandInitializer { | ||
static $inject: string[] | ||
constructor(eventBus: EventBus, commandStack: CommandStack) { | ||
eventBus.on('diagram.init', function () { | ||
Object.keys(HANDLERS).forEach((id: string) => commandStack.registerHandler(id, HANDLERS[id])) | ||
}) | ||
} | ||
} | ||
|
||
CommandInitializer.$inject = ['eventBus', 'commandStack'] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import CommandInitializer from './CommandInitializer' | ||
|
||
export default { | ||
__init__: [CommandInitializer] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters