feat(editor-actions): allow selecting element and scrolling it into view

This commit is contained in:
Philipp 2021-07-12 11:23:34 +02:00
parent 032da0d17a
commit a46b266973
1 changed files with 16 additions and 0 deletions

View File

@ -71,6 +71,22 @@ BpmnEditorActions.prototype._registerDefaultActions = function(injector) {
});
}
if (canvas && elementRegistry && selection) {
this._registerAction('selectElement', function(options) {
var rootElement = canvas.getRootElement();
var element = elementRegistry.get(options && options.id);
if (element && element !== rootElement) {
selection.select(element);
canvas.scrollToElement(element);
}
return element;
});
}
if (spaceTool) {
this._registerAction('spaceTool', function() {
spaceTool.toggle();