mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Fix relative positioned tooltips. Fixes #319
This commit is contained in:
22
js/lib/bootstrap-tooltip.js
vendored
22
js/lib/bootstrap-tooltip.js
vendored
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user