Skip to content

Commit

Permalink
Reset all CSS classes on third selected shape
Browse files Browse the repository at this point in the history
  • Loading branch information
csouchet committed Feb 8, 2023
1 parent efec3a7 commit 396c8ed
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions demo/visualize-path/js/monitoring-use-case.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ class PathUseCase extends UseCase {

this._allShapes.forEach(item => {
item.htmlElement.onclick = () => {
if(this._state.firstSelectedShape && this._state.secondSelectedShape){
this._bpmnVisualization.bpmnElementsRegistry.removeCssClasses([...this._allShapes, ...this._allEdges].map(shapeOrEdge => shapeOrEdge.bpmnSemantic.id), ['disableAll', 'possibleNext', 'highlight']);
this._state.firstSelectedShape = undefined;
this._state.secondSelectedShape = undefined;
this._state.edge = undefined;
}

if (!this._state.firstSelectedShape) {
[...this._allShapes, ...this._allEdges].filter(shapeOrEdge => shapeOrEdge !== item).forEach(shapeOrEdge => this._bpmnVisualization.bpmnElementsRegistry.addCssClasses(shapeOrEdge.bpmnSemantic.id, 'disableAll'));
this._bpmnVisualization.bpmnElementsRegistry.addCssClasses(item.bpmnSemantic.id, 'highlight');
Expand Down

0 comments on commit 396c8ed

Please sign in to comment.