mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Merge pull request #14278 from Snuffleupagus/rm-removeChild
Replace the remaining `Node.removeChild()` instances with `Element.remove()`
This commit is contained in:
commit
3dccaccbb4
7 changed files with 10 additions and 14 deletions
|
@ -462,9 +462,7 @@ const Stepper = (function StepperClosure() {
|
|||
var Stats = (function Stats() {
|
||||
let stats = [];
|
||||
function clear(node) {
|
||||
while (node.hasChildNodes()) {
|
||||
node.removeChild(node.lastChild);
|
||||
}
|
||||
node.textContent = ""; // Remove any `node` contents from the DOM.
|
||||
}
|
||||
function getStatIndex(pageNumber) {
|
||||
for (let i = 0, ii = stats.length; i < ii; ++i) {
|
||||
|
@ -490,8 +488,7 @@ var Stats = (function Stats() {
|
|||
}
|
||||
const statsIndex = getStatIndex(pageNumber);
|
||||
if (statsIndex !== false) {
|
||||
const b = stats[statsIndex];
|
||||
this.panel.removeChild(b.div);
|
||||
stats[statsIndex].div.remove();
|
||||
stats.splice(statsIndex, 1);
|
||||
}
|
||||
const wrapper = document.createElement("div");
|
||||
|
|
|
@ -259,7 +259,7 @@ class PDFPageView {
|
|||
case xfaLayerNode:
|
||||
continue;
|
||||
}
|
||||
div.removeChild(node);
|
||||
node.remove();
|
||||
}
|
||||
div.removeAttribute("data-loaded");
|
||||
|
||||
|
@ -540,7 +540,7 @@ class PDFPageView {
|
|||
this.renderingState = RenderingStates.FINISHED;
|
||||
|
||||
if (this.loadingIconDiv) {
|
||||
div.removeChild(this.loadingIconDiv);
|
||||
this.loadingIconDiv.remove();
|
||||
delete this.loadingIconDiv;
|
||||
}
|
||||
return Promise.reject(new Error("pdfPage is not loaded"));
|
||||
|
@ -644,7 +644,7 @@ class PDFPageView {
|
|||
this.renderingState = RenderingStates.FINISHED;
|
||||
|
||||
if (this.loadingIconDiv) {
|
||||
div.removeChild(this.loadingIconDiv);
|
||||
this.loadingIconDiv.remove();
|
||||
delete this.loadingIconDiv;
|
||||
}
|
||||
this._resetZoomLayer(/* removeFromDOM = */ true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue