mirror of
https://github.com/sartography/cr-connect-bpmn.git
synced 2025-01-11 17:44:32 +00:00
Re-initializes the modeler when a new file is selected
This commit is contained in:
parent
a59d5120a1
commit
b00486251a
@ -1,5 +1,5 @@
|
||||
import {HttpErrorResponse} from '@angular/common/http';
|
||||
import {AfterViewInit, Component, ElementRef, EventEmitter, NgZone, Output, ViewChild} from '@angular/core';
|
||||
import {AfterViewInit, Component, ElementRef, EventEmitter, NgZone, Output, Renderer2, ViewChild} from '@angular/core';
|
||||
import {ControlValueAccessor} from '@angular/forms';
|
||||
import * as bpmnPropertiesPanelModule from 'bpmn-js-properties-panel';
|
||||
import * as bpmnPropertiesProviderModule from 'bpmn-js-properties-panel/lib/provider/camunda';
|
||||
@ -56,6 +56,8 @@ export class DiagramComponent implements ControlValueAccessor, AfterViewInit {
|
||||
}
|
||||
|
||||
initializeModeler(diagramType) {
|
||||
this.clearElements();
|
||||
|
||||
if (diagramType === 'dmn') {
|
||||
this.initializeDMNModeler();
|
||||
} else {
|
||||
@ -201,4 +203,11 @@ export class DiagramComponent implements ControlValueAccessor, AfterViewInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private clearElements() {
|
||||
const els: HTMLElement[] = [this.containerRef.nativeElement, this.propertiesRef.nativeElement];
|
||||
els.forEach(e => {
|
||||
e.innerHTML = '';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user