Skip to content

Commit

Permalink
Little cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmervdl committed Jun 13, 2022
1 parent eace68c commit 43e6037
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions extension/view/js/InPageTranslation.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function removeTextNodes(node) {
break;
}
});
``};
}

// eslint-disable-next-line no-unused-vars
class InPageTranslation {
Expand Down Expand Up @@ -408,7 +408,7 @@ class InPageTranslation {
// TODO There is probably a quicker way to do this
for (let child of node.childNodes) {
switch (child.nodeType) {
case 3: // TextNode
case Node.TEXT_NODE: // TextNode
if (child.textContent.trim() !== "")
return true;
break;
Expand Down Expand Up @@ -603,10 +603,6 @@ class InPageTranslation {
.filter(child => child.nodeType === Node.ELEMENT_NODE)
.map(child => [child.dataset.xBergamotId, child]));

const srcChildNodes = new Set(Array.from(src.childNodes)
.filter(child => child.nodeType === Node.ELEMENT_NODE)
.map(child => child.dataset.xBergamotId));

// src (translated) dictates the order.
Array.from(src.childNodes).forEach(child => {
// Element nodes we try to use the already existing DOM nodes
Expand Down

0 comments on commit 43e6037

Please sign in to comment.