Skip to content

Commit

Permalink
Make Hover clickable
Browse files Browse the repository at this point in the history
+ remove debug output
  • Loading branch information
JBenda committed Jul 24, 2020
1 parent 08f637d commit cdb709f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions firefox/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ function addHover(node) {
link = node.attributes.getNamedItem('bookmark');
}
if(link) {
console.log('hit')
span = document.createElement("span");
span.classList.add('tooltiptext');
text = document.createTextNode(link.value);
Expand All @@ -18,6 +17,7 @@ function addHover(node) {
const bb = span.getClientRects()[0];
span.style.left = (rect.x + rect.width/2 - bb.width/2)+'px';
span.style.top = (rect.y+rect.height/2 - bb.height/2)+'px';
url = (' '+ link.value).slice(1); // deep copy
node.addEventListener('mouseover', function(){
span.timer = setTimeout(function() {
span.style.visibility="visible";
Expand All @@ -36,7 +36,7 @@ function addHover(node) {
}
})
span.addEventListener('click', function(){
wopen(link.value);
wopen(url);
})
}

Expand Down

0 comments on commit cdb709f

Please sign in to comment.