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
@ -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…
x
Reference in New Issue
Block a user