Skip to content

Commit

Permalink
bar.js: added timeout on mouseover for panel
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Oct 29, 2018
1 parent 4c3f827 commit 3f0d0cb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Tracy/assets/Bar/bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,12 @@
});

link.addEventListener('mouseenter', e => {
if (!e.buttons && link.rel && link.rel !== 'close' && !elem.classList.contains('tracy-dragged')) {
if (e.buttons || !link.rel || link.rel === 'close' || elem.classList.contains('tracy-dragged')) {
return;
}

clearTimeout(this.displayTimeout);
this.displayTimeout = setTimeout(() => {
var panel = Debug.panels[link.rel];
panel.focus();

Expand All @@ -294,10 +299,12 @@
});
panel.peekPosition = true;
}
}
}, 50);
});

link.addEventListener('mouseleave', () => {
clearTimeout(this.displayTimeout);

if (link.rel && link.rel !== 'close' && !elem.classList.contains('tracy-dragged')) {
Debug.panels[link.rel].blur();
}
Expand Down

0 comments on commit 3f0d0cb

Please sign in to comment.