Clean up inspector setup

This commit is contained in:
John Firebaugh
2012-12-03 17:26:38 -05:00
parent 60941f701b
commit 38958515d8
3 changed files with 5 additions and 11 deletions
+2 -1
View File
@@ -107,7 +107,8 @@ var iD = function(container) {
.on('click', function(d) { return d[2](); });
this.append('div')
.attr('class', 'inspector-wrap').style('display', 'none');
.attr('class', 'inspector-wrap')
.style('display', 'none');
this.append('div')
.attr('id', 'about')
+3 -9
View File
@@ -129,9 +129,6 @@ iD.Map = function() {
arrow.remove();
map.size(this.size());
hideInspector();
map.surface = surface;
}
@@ -442,7 +439,8 @@ iD.Map = function() {
selection = entity.id;
d3.select('.inspector-wrap')
.style('display', 'block')
.datum(map.history.graph().fetch(entity.id)).call(inspector);
.datum(map.history.graph().fetch(entity.id))
.call(inspector);
redraw();
}
@@ -451,11 +449,7 @@ iD.Map = function() {
if (entity) entity = entity[0];
if (!entity || selection === entity.id || (entity.tags && entity.tags.elastic)) return;
if (entity.type === 'way') d3.select(d3.event.target).call(waydragbehavior);
selection = entity.id;
d3.select('.inspector-wrap')
.style('display', 'block')
.datum(map.history.graph().fetch(entity.id)).call(inspector);
redraw();
selectEntity(entity);
}
function removeEntity(entity) {
-1
View File
@@ -141,6 +141,5 @@ iD.Inspector = function() {
});
}
return d3.rebind(inspector, event, 'on');
};