1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-23 00:28:06 +02:00

Use DOM hidden property instead of attribute methods

This commit is contained in:
Tim Nguyen 2021-02-08 00:21:49 +01:00
parent 3d33313e4e
commit 2ca886baee
6 changed files with 46 additions and 58 deletions

View file

@ -1353,7 +1353,7 @@ class PopupElement {
// annotation, we cannot hide the entire container as the image would
// disappear too. In that special case, hiding the wrapper suffices.
this.hideElement = this.hideWrapper ? wrapper : this.container;
this.hideElement.setAttribute("hidden", true);
this.hideElement.hidden = true;
const popup = document.createElement("div");
popup.className = "popup";
@ -1451,8 +1451,8 @@ class PopupElement {
if (pin) {
this.pinned = true;
}
if (this.hideElement.hasAttribute("hidden")) {
this.hideElement.removeAttribute("hidden");
if (this.hideElement.hidden) {
this.hideElement.hidden = false;
this.container.style.zIndex += 1;
}
}
@ -1468,8 +1468,8 @@ class PopupElement {
if (unpin) {
this.pinned = false;
}
if (!this.hideElement.hasAttribute("hidden") && !this.pinned) {
this.hideElement.setAttribute("hidden", true);
if (!this.hideElement.hidden && !this.pinned) {
this.hideElement.hidden = true;
this.container.style.zIndex -= 1;
}
}
@ -2061,7 +2061,7 @@ class AnnotationLayer {
});
}
}
parameters.div.removeAttribute("hidden");
parameters.div.hidden = false;
}
}