mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-02-15 10:26:47 +00:00
* use ES6 import / export * UTILS: export individual utilities * TESTS: localize TestHelper includes BREAKING CHANGE: * all utilities export independent functions * library sources got ported to ES6. You must now use a ES module bundler such as Browserify + babelify or Webpack to consume this library (or parts of it).
37 lines
755 B
JavaScript
37 lines
755 B
JavaScript
import AutoResize from 'diagram-js/lib/features/auto-resize/AutoResize';
|
|
|
|
import inherits from 'inherits';
|
|
|
|
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 {Object} newBounds
|
|
*/
|
|
BpmnAutoResize.prototype.resize = function(target, newBounds) {
|
|
|
|
if (is(target, 'bpmn:Participant')) {
|
|
this._modeling.resizeLane(target, newBounds);
|
|
} else {
|
|
this._modeling.resizeShape(target, newBounds);
|
|
}
|
|
}; |