Skip to content

Commit

Permalink
[Selection] fix css on window close
Browse files Browse the repository at this point in the history
  • Loading branch information
HenFo committed Nov 21, 2024
1 parent 0312d19 commit 0c5380a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class ClickController {
destroy() {
this.tooltip.destroy();
unByKey(this.eventKey);
deactivateViewportInteraction(this.olMap);
deactivateViewportInteraction(this.olMap, true);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export class DragController {
this.interactionResources.forEach((interaction) => {
interaction.destroy();
});
deactivateViewportInteraction(this.olMap, true);
}

setActive(isActive: boolean) {
Expand Down
5 changes: 3 additions & 2 deletions src/packages/selection/selection-controller/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ export function activateViewportInteraction(map: OlMap) {
/**
* Applies appropriate css classes from the viewport to indicate that the selection process is inactive
*/
export function deactivateViewportInteraction(map: OlMap) {
export function deactivateViewportInteraction(map: OlMap, destroy = true) {
const viewPort = map.getViewport();
viewPort.classList.remove(ACTIVE_CLASS);
viewPort.classList.add(INACTIVE_CLASS);
if (!destroy)
viewPort.classList.add(INACTIVE_CLASS);
}

/**
Expand Down

0 comments on commit 0c5380a

Please sign in to comment.