feat(test): expose BpmnJS set and clear utilities
This commit is contained in:
parent
a86b1476dd
commit
991ab38c3d
|
@ -112,14 +112,13 @@ export function bootstrapBpmnJS(BpmnJS, diagram, options, locals) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// clean up old bpmn-js instance
|
clearBpmnJS();
|
||||||
if (BPMN_JS) {
|
|
||||||
BPMN_JS.destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
BPMN_JS = new BpmnJS(_options);
|
var instance = new BpmnJS(_options);
|
||||||
|
|
||||||
BPMN_JS.importXML(diagram, done);
|
setBpmnJS(instance);
|
||||||
|
|
||||||
|
instance.importXML(diagram, done);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,6 +226,19 @@ export function getBpmnJS() {
|
||||||
return BPMN_JS;
|
return BPMN_JS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function clearBpmnJS() {
|
||||||
|
|
||||||
|
// clean up old bpmn-js instance
|
||||||
|
if (BPMN_JS) {
|
||||||
|
BPMN_JS.destroy();
|
||||||
|
|
||||||
|
BPMN_JS = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function setBpmnJS(instance) {
|
||||||
|
BPMN_JS = instance;
|
||||||
|
}
|
||||||
|
|
||||||
export function insertCSS(name, css) {
|
export function insertCSS(name, css) {
|
||||||
if (document.querySelector('[data-css-file="' + name + '"]')) {
|
if (document.querySelector('[data-css-file="' + name + '"]')) {
|
||||||
|
|
Loading…
Reference in New Issue