[Editor] Remove the stamp editor displayed when the image was loading (bug 1848313)

Make the annotation editor layer unclickable while the image is loading and
change the cursor to 'wait'.
This commit is contained in:
Calixte Denizet 2023-08-11 14:15:15 +02:00
parent 4eca3ca199
commit d527fb3ff2
4 changed files with 53 additions and 89 deletions

View file

@ -547,6 +547,8 @@ class AnnotationEditorUIManager {
#isEnabled = false;
#isWaiting = false;
#lastActiveElement = null;
#mode = AnnotationEditorType.NONE;
@ -1159,6 +1161,21 @@ class AnnotationEditorUIManager {
}
}
enableWaiting(mustWait = false) {
if (this.#isWaiting === mustWait) {
return;
}
this.#isWaiting = mustWait;
for (const layer of this.#allLayers.values()) {
if (mustWait) {
layer.disableClick();
} else {
layer.enableClick();
}
layer.div.classList.toggle("waiting", mustWait);
}
}
/**
* Enable all the layers.
*/