Fix relative positioned tooltips. Fixes #319

This commit is contained in:
Tom MacWright
2013-01-07 18:15:02 -05:00
parent ed032be98f
commit 52312e28fd

View File

@@ -155,12 +155,22 @@
};
function getPosition(node) {
return {
x: node.offsetLeft,
y: node.offsetTop,
w: node.offsetWidth,
h: node.offsetHeight
};
var mode = d3.select(node).style('position');
if (mode === 'absolute' || mode === 'static') {
return {
x: node.offsetLeft,
y: node.offsetTop,
w: node.offsetWidth,
h: node.offsetHeight
};
} else {
return {
x: 0,
y: 0,
w: node.offsetWidth,
h: node.offsetHeight
};
}
}
})(this);