Skip to content

Commit

Permalink
Fix issue of threads jumping around... Again
Browse files Browse the repository at this point in the history
  • Loading branch information
rlazar committed Apr 14, 2020
1 parent 3150482 commit 5cd3502
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions content.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ function addStyle() {

function main() {
var scrollContainer = document.querySelector('c-wiz[data-group-id][data-is-client-side] > div:nth-child(1)');
var copyButtonInsertedCount = 0;
document.querySelectorAll("c-wiz[data-topic-id]")
.forEach(
function(e,t,i){
Expand Down Expand Up @@ -146,12 +147,17 @@ function main() {

buttonContainer.parentElement.style = 'display: inline-block; width: unset; opacity: 1;';
buttonContainer.parentElement.parentElement.appendChild(copyButton);
scrollContainer.scrollTop += 72;
buttonContainer.parentElement.parentElement.parentElement.parentElement.style = 'padding: 56px 0;';
copyButtonInsertedCount += 1;
scrollContainer.scrollTop += 36;
buttonContainer.parentElement.parentElement.parentElement.parentElement.style = 'padding-top: 56px;';
}
}
}
);

if (copyButtonInsertedCount > 1) {
scrollContainer.scrollTop += 36;
}
}

function debounce(fn, delay) {
Expand Down

0 comments on commit 5cd3502

Please sign in to comment.