Fix error when hovering way accuracy handles

This commit is contained in:
John Firebaugh
2012-12-06 15:08:07 -05:00
parent 44959a834d
commit d02e35e16b

View File

@@ -280,17 +280,21 @@ iD.Map = function() {
}
function hoverIn() {
var entity = d3.select(d3.event.target).datum();
hover = entity.id;
drawVector(iD.util.trueObj([hover]));
d3.select('.messages').text(entity.tags.name || '#' + entity.id);
var datum = d3.select(d3.event.target).datum();
if (datum instanceof iD.Entity) {
hover = datum.id;
drawVector(iD.util.trueObj([hover]));
d3.select('.messages').text(datum.tags.name || '#' + datum.id);
}
}
function hoverOut() {
var oldHover = hover;
hover = null;
drawVector(iD.util.trueObj([oldHover]));
d3.select('.messages').text('');
if (hover) {
var oldHover = hover;
hover = null;
drawVector(iD.util.trueObj([oldHover]));
d3.select('.messages').text('');
}
}
function zoomPan() {