mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-28 02:42:36 +02:00
Guard against Firefox bug around hidden elements. Fixes #328
This commit is contained in:
@@ -338,7 +338,12 @@ iD.Map = function() {
|
||||
}
|
||||
|
||||
map.mouseCoordinates = function() {
|
||||
return projection.invert(d3.mouse(surface.node()));
|
||||
try {
|
||||
return projection.invert(d3.mouse(surface.node()));
|
||||
} catch(e) {
|
||||
// when called with hidden elements, d3.mouse() will throw
|
||||
return [NaN, NaN];
|
||||
}
|
||||
};
|
||||
|
||||
map.dblclickEnable = function(_) {
|
||||
|
||||
Reference in New Issue
Block a user