Skip to content

Commit e37100b

Browse files
committed
fix(popup): put mouseover link on right side of mouse on lower left
1 parent 0e9ea61 commit e37100b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

popup/popup.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,11 @@ const hoverLinks = ($video) => {
396396
$link.addEventListener('mouseover', (e) => {
397397
e.stopPropagation();
398398
$hoverLink.textContent = url;
399+
// Place the link on the right side if the mouse is close to
400+
// the lower left side of the window.
401+
$hoverLink.classList.toggle('right',
402+
window.innerHeight - e.clientY < VIDEO_HEIGHT &&
403+
e.clientX < window.innerWidth / 2);
399404
document.body.append($hoverLink);
400405
});
401406
$link.addEventListener('mouseleave', () => {

popup/style.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,3 +509,9 @@ a.close[data-title]:hover:after {
509509
line-height: 15px;
510510
z-index: 99;
511511
}
512+
513+
.mouseover-link.right {
514+
left: unset;
515+
right: 0;
516+
max-width: 50%;
517+
}

0 commit comments

Comments
 (0)