mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-02-24 14:48:21 +00:00
The project logo now properly embeds in the Viewer and links to bpmn.io. This way, we are able to ship it as part of a bpmn-js bundle. In addition to that change this commit upgrades to the latest diagram-js release, too which adds support for Diagram#destroy(). Closes #15
29 lines
653 B
JavaScript
29 lines
653 B
JavaScript
var Diagram = require('diagram-js');
|
|
|
|
var bpmnModule = require('./di').defaultModule,
|
|
Viewer = require('./Viewer');
|
|
|
|
require('./core/BpmnRegistry');
|
|
|
|
require('./draw/BpmnRenderer');
|
|
|
|
require('diagram-js/lib/features/dnd/Visuals');
|
|
require('diagram-js/lib/features/selection/Visuals');
|
|
|
|
|
|
function Modeler(options) {
|
|
Viewer.call(this, options);
|
|
}
|
|
|
|
Modeler.prototype = Object.create(Viewer.prototype);
|
|
|
|
Modeler.prototype.createDiagram = function() {
|
|
|
|
return new Diagram({
|
|
canvas: { container: this.container },
|
|
modules: [ bpmnModule ],
|
|
components: [ 'selectionVisuals', 'dragVisuals', 'bpmnRegistry']
|
|
});
|
|
};
|
|
|
|
module.exports = Modeler; |