Skip to content

Commit 469ab7e

Browse files
authored
Update userscript.js
1 parent 5ace89d commit 469ab7e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/addons/addons/multi-tab-code/userscript.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,16 +482,16 @@ export default async function ({ addon, msg, console }) {
482482
selectStartScroll = scroll;
483483
selectStartX = e.x;
484484
}
485-
document.onmouseup = () => scrollSelected = false;
486-
document.onmousemove = e => {
485+
document.addEventListener('mouseup', () => scrollSelected = false);
486+
document.addEventListener('mousemove', e => {
487487
if (!scrollSelected) return;
488488
const bodySize = tabScroller.getBoundingClientRect();
489489
const wrapperSize = tabWrapper.getBoundingClientRect();
490490
const diff = bodySize.width - wrapperSize.width;
491491
scroll = Math.max(Math.min((e.x - selectStartX) + selectStartScroll, diff), 0);
492492
scrollBar.style.left = `${scroll}px`;
493493
tabScroller.style.left = `-${scroll}px`;
494-
}
494+
});
495495
function loadTabs() {
496496
for (const comment of Object.values(tabTarget.comments))
497497
if (comment.text.startsWith(commentId))

0 commit comments

Comments
 (0)