Work around browser incompatibilities

This commit is contained in:
John Firebaugh
2013-08-09 12:15:48 -07:00
parent b5aea1e8d2
commit 70a36bee60

View File

@@ -66,7 +66,9 @@ iD.ui.RadialMenu = function(context, operations) {
.attr('class', 'tooltip-inner radial-menu-tooltip');
function mouseover(d, i) {
var rect = context.surface().node().getBoundingClientRect(),
// Avoid getBoundingClientRect on SVG element; browser implementations
// differ: http://stackoverflow.com/questions/18153989/
var rect = context.surface().node().parentNode.getBoundingClientRect(),
angle = a0 + i * a,
dx = rect.left - (angle < 0 ? 200 : 0),
dy = rect.top;