Skip to content

Commit

Permalink
Popup: allow toggling of active state
Browse files Browse the repository at this point in the history
  • Loading branch information
nboisteault committed Jun 20, 2024
1 parent bc54ed5 commit 4e9ee64
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion assets/src/modules/Popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import DOMPurify from 'dompurify';
*/
export default class Popup {
constructor() {
// Allow toggling of active state
this.active = true;

// OL2
OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
defaultHandlerOptions: {
Expand Down Expand Up @@ -79,7 +82,7 @@ export default class Popup {
const lineTolerance = mainLizmap.config.options?.lineTolerance || 10;
const polygonTolerance = mainLizmap.config.options?.polygonTolerance || 5;

if (lizMap.editionPending || mainLizmap.selectionTool.isActive || mainLizmap.digitizing.isActive) {
if (!this.active || lizMap.editionPending || mainLizmap.selectionTool.isActive || mainLizmap.digitizing.isActive) {
return;
}

Expand Down

0 comments on commit 4e9ee64

Please sign in to comment.