diff --git a/js/id/modes/select.js b/js/id/modes/select.js index b253d606d..e1a24f18c 100644 --- a/js/id/modes/select.js +++ b/js/id/modes/select.js @@ -103,7 +103,8 @@ iD.modes.Select = function(context, selection) { } if (singular()) { - inspector = iD.ui.Inspector(context, singular()) + inspector = iD.ui.Inspector(context) + .entityID(singular().id) .newFeature(newFeature); wrap.call(inspector); diff --git a/js/id/ui/inspector.js b/js/id/ui/inspector.js index 72c74da87..d64601d75 100644 --- a/js/id/ui/inspector.js +++ b/js/id/ui/inspector.js @@ -1,11 +1,13 @@ -iD.ui.Inspector = function(context, entity) { +iD.ui.Inspector = function(context) { var presetList, entityEditor, + entityID, newFeature = false; function inspector(selection) { - var reselect = selection.html(); + var reselect = selection.html(), + entity = context.entity(entityID); selection .html('') @@ -90,6 +92,12 @@ iD.ui.Inspector = function(context, entity) { }); }; + inspector.entityID = function(_) { + if (!arguments.length) return entityID; + entityID = _; + return inspector; + }; + inspector.newFeature = function(_) { if (!arguments.length) return newFeature; newFeature = _;