mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-02-03 20:53:25 +00:00
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
|
||||
if (BPMN_JS) {
|
||||
BPMN_JS.destroy();
|
||||
}
|
||||
clearBpmnJS();
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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) {
|
||||
if (document.querySelector('[data-css-file="' + name + '"]')) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user