Skip to content

Commit

Permalink
converted to foreach as requested in PR liady#7
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianmarinwork committed Dec 6, 2022
1 parent 9e3db0c commit 327926a
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/content_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,16 @@ function downloadThread({ as = Format.PNG } = {}) {
onclone: function (cloneDoc) {
//Make small fix of position to all the text containers
let listOfTexts = cloneDoc.getElementsByClassName('min-h-[20px]');

for (let i = 0, leng = listOfTexts.length; i < leng; i++) {
let text = listOfTexts[i];
text.style['position'] = 'relative';
text.style['top'] = '-8px';
}
Array.from(listOfTexts).forEach((text) => {
text.style.position = 'relative';
text.style.top = '-8px';
});

//Delete copy button from code blocks
let listOfCopyBtns = cloneDoc.querySelectorAll('button.flex');

for (let i = 0, leng = listOfCopyBtns.length; i < leng; i++) {
let button = listOfCopyBtns[i];
button.remove();
}
Array.from(listOfCopyBtns).forEach(
(btn) => (btn.remove())
);
}
}
).then(async function (canvas) {
Expand Down

0 comments on commit 327926a

Please sign in to comment.