mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
[Editor] Make the annotation editor layer invisible when disabled and empty
It'll help to avoid to consider them when the browser is restyling.
This commit is contained in:
parent
2d87a2eb1c
commit
185281957d
2 changed files with 22 additions and 6 deletions
|
@ -75,6 +75,7 @@ class AnnotationEditorLayerBuilder {
|
|||
const div = (this.div = document.createElement("div"));
|
||||
div.className = "annotationEditorLayer";
|
||||
div.tabIndex = 0;
|
||||
div.hidden = true;
|
||||
this.pageDiv.append(div);
|
||||
|
||||
this.annotationEditorLayer = new AnnotationEditorLayer({
|
||||
|
@ -94,6 +95,7 @@ class AnnotationEditorLayerBuilder {
|
|||
};
|
||||
|
||||
this.annotationEditorLayer.render(parameters);
|
||||
this.show();
|
||||
}
|
||||
|
||||
cancel() {
|
||||
|
@ -115,7 +117,7 @@ class AnnotationEditorLayerBuilder {
|
|||
}
|
||||
|
||||
show() {
|
||||
if (!this.div) {
|
||||
if (!this.div || this.annotationEditorLayer.isEmpty) {
|
||||
return;
|
||||
}
|
||||
this.div.hidden = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue