From 83d0b6cb55744365d6a811e320bbdd7a3f3f012c Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Fri, 1 Dec 2023 17:10:19 +0100 Subject: [PATCH] [Editor] Disable mouse events when leaving the highlight mode --- src/display/editor/highlight.js | 12 ++++++++++++ web/annotation_editor_layer_builder.css | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/src/display/editor/highlight.js b/src/display/editor/highlight.js index c9b85a9e3..0aa66d8d2 100644 --- a/src/display/editor/highlight.js +++ b/src/display/editor/highlight.js @@ -198,6 +198,18 @@ class HighlightEditor extends AnnotationEditor { }); } + /** @inheritdoc */ + disableEditing() { + super.disableEditing(); + this.div.classList.toggle("disabled", true); + } + + /** @inheritdoc */ + enableEditing() { + super.enableEditing(); + this.div.classList.toggle("disabled", false); + } + /** @inheritdoc */ fixAndSetPosition() { return super.fixAndSetPosition(0); diff --git a/web/annotation_editor_layer_builder.css b/web/annotation_editor_layer_builder.css index 206b06a6f..0786ec7c8 100644 --- a/web/annotation_editor_layer_builder.css +++ b/web/annotation_editor_layer_builder.css @@ -954,6 +954,10 @@ pointer-events: auto; } + &.disabled .internal { + pointer-events: none; + } + &.selectedEditor { .internal { cursor: pointer;