mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Use remove
, rather than removeChild
, when removing the temporary Text
nodes used in FirefoxCom
This is the "modern" way of removing a node from the DOM, which has the benefit of being a lot shorter and more concise. Also, this patch removes the `return` statement from the "pdf.js.response" event listener, since it's always `undefined`, given that none of the `callback`-functions used here ever return anything (and don't need to either). Generally speaking, returning a value from an event listener isn't normally necessary either.
This commit is contained in:
parent
cc49b65a11
commit
99b1a62c97
1 changed files with 4 additions and 4 deletions
|
@ -48,7 +48,8 @@ const FirefoxCom = (function FirefoxComClosure() {
|
|||
});
|
||||
request.dispatchEvent(sender);
|
||||
const response = sender.detail.response;
|
||||
document.documentElement.removeChild(request);
|
||||
request.remove();
|
||||
|
||||
return response;
|
||||
},
|
||||
|
||||
|
@ -68,10 +69,9 @@ const FirefoxCom = (function FirefoxComClosure() {
|
|||
event => {
|
||||
const node = event.target;
|
||||
const response = event.detail.response;
|
||||
node.remove();
|
||||
|
||||
document.documentElement.removeChild(node);
|
||||
|
||||
return callback(response);
|
||||
callback(response);
|
||||
},
|
||||
{ once: true }
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue