mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-01-16 03:54:31 +00:00
7478388070
This increase the safety of our build; external consumers do no longer need to account for the `browser` field to bundle bpmn-js (or otherwise bundle a Node shim, unintentionally).
38 lines
820 B
JavaScript
38 lines
820 B
JavaScript
import AutoResize from 'diagram-js/lib/features/auto-resize/AutoResize';
|
|
|
|
import inherits from 'inherits-browser';
|
|
|
|
import { is } from '../../util/ModelUtil';
|
|
|
|
|
|
/**
|
|
* Sub class of the AutoResize module which implements a BPMN
|
|
* specific resize function.
|
|
*/
|
|
export default function BpmnAutoResize(injector) {
|
|
|
|
injector.invoke(AutoResize, this);
|
|
}
|
|
|
|
BpmnAutoResize.$inject = [
|
|
'injector'
|
|
];
|
|
|
|
inherits(BpmnAutoResize, AutoResize);
|
|
|
|
|
|
/**
|
|
* Resize shapes and lanes.
|
|
*
|
|
* @param {djs.model.Shape} target
|
|
* @param {Bounds} newBounds
|
|
* @param {Object} hints
|
|
*/
|
|
BpmnAutoResize.prototype.resize = function(target, newBounds, hints) {
|
|
|
|
if (is(target, 'bpmn:Participant')) {
|
|
this._modeling.resizeLane(target, newBounds, null, hints);
|
|
} else {
|
|
this._modeling.resizeShape(target, newBounds, null, hints);
|
|
}
|
|
}; |