From 38958515d8f729777dcd2719c24b709ea86a6339 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Mon, 3 Dec 2012 17:26:38 -0500 Subject: [PATCH] Clean up inspector setup --- js/id/id.js | 3 ++- js/id/renderer/map.js | 12 +++--------- js/id/ui/inspector.js | 1 - 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/js/id/id.js b/js/id/id.js index 8d178901e..a8600c42c 100644 --- a/js/id/id.js +++ b/js/id/id.js @@ -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') diff --git a/js/id/renderer/map.js b/js/id/renderer/map.js index a6219db8a..cd8c4d908 100644 --- a/js/id/renderer/map.js +++ b/js/id/renderer/map.js @@ -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) { diff --git a/js/id/ui/inspector.js b/js/id/ui/inspector.js index 7e9ea12bb..96c6185a2 100644 --- a/js/id/ui/inspector.js +++ b/js/id/ui/inspector.js @@ -141,6 +141,5 @@ iD.Inspector = function() { }); } - return d3.rebind(inspector, event, 'on'); };