feat(editor-actions): allow selecting element and scrolling it into view
This commit is contained in:
parent
032da0d17a
commit
a46b266973
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue