Permalink
Browse files

comments

  • Loading branch information...
1 parent 9963626 commit 76441a7bd2f988d6f7c04271086031e748a14bb0 @invalid-email-address invalid-email-address committed Dec 26, 2012
Showing with 9 additions and 14 deletions.
  1. +6 −14 src/contentscript.js
  2. +3 −0 src/contentstyle.css
View
@@ -8,33 +8,25 @@ function $(s){
return document.querySelectorAll(s);
}
-function prepend(child){
- this.insertBefore(child, this.firstChild);
-}
-
-
var tt = document.createElement('div');
tt.className = "graph-tooltip";
document.body.appendChild(tt);
-
function over(){
- var parent = this;
- var img = parent.getElementsByTagName('img')[0];
- var rect = parent.getBoundingClientRect();
+ var td = this;
+ var img = td.getElementsByTagName('img')[0];
+ var rect = td.getBoundingClientRect();
tt.innerText = img.alt;
tt.style.display = "block";
tt.style.top = window.scrollY + rect.top - rect.height - 28 + 'px'; // 30 is the height of the tooltip
tt.style.left = window.scrollX + rect.left + (rect.width/2) - 100 + 'px'; // 100 is half of the width of the tooltip
- // console.log(window.scrollY + rect.top - rect.height - 30, window.scrollX + rect.left - rect.width);
}
function out(){
tt.style.display = "none";
}
-[].forEach.call($('table.tt_graph img'), function(el){
- var parent = el.parentNode;
- parent.onmouseover = over;
- parent.onmouseout = out;
+[].forEach.call($('table.tt_graph td'), function(td){
+ td.onmouseover = over;
+ td.onmouseout = out;
});
@@ -1,5 +1,7 @@
+
.alertHeader { display: none; }
+/* make these twice as tall, easier to mouse-over (jira-defined height is 4px for these) */
table.tt_graph,
table.tt_graph td,
table.tt_graph img { height:8px !important; font-size: 8px/8px arial; }
@@ -19,6 +21,7 @@ table.tt_graph img { display:block; }
left:0;
}
+/* down-pointing triangle */
.graph-tooltip:after{
content:" ";
display: block;

0 comments on commit 76441a7

Please sign in to comment.