From b70b287dee4c27b7fc8f5f84580ec7065f5d04b2 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 15 May 2013 16:38:52 -0700 Subject: [PATCH] Rename TagEditor -> EntityEditor It's going to be used to edit relation memberships as well as tags. --- index.html | 2 +- js/id/ui/{tag_editor.js => entity_editor.js} | 14 +++++++------- js/id/ui/inspector.js | 10 +++++----- test/index.html | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) rename js/id/ui/{tag_editor.js => entity_editor.js} (92%) diff --git a/index.html b/index.html index 1a67cd26f..f838354a4 100644 --- a/index.html +++ b/index.html @@ -93,7 +93,7 @@ - + diff --git a/js/id/ui/tag_editor.js b/js/id/ui/entity_editor.js similarity index 92% rename from js/id/ui/tag_editor.js rename to js/id/ui/entity_editor.js index 9c7f9db5a..4c8888dd1 100644 --- a/js/id/ui/tag_editor.js +++ b/js/id/ui/entity_editor.js @@ -1,4 +1,4 @@ -iD.ui.TagEditor = function(context, entity) { +iD.ui.EntityEditor = function(context, entity) { var event = d3.dispatch('choose', 'close'), presets = context.presets(), id = entity.id, @@ -17,7 +17,7 @@ iD.ui.TagEditor = function(context, entity) { // change preset if necessary (undos/redos) var newmatch = presets.match(entity, context.graph()); if (newmatch !== preset) { - tageditor(selection_, newmatch); + entityEditor(selection_, newmatch); return; } @@ -25,7 +25,7 @@ iD.ui.TagEditor = function(context, entity) { tagList.tags(tags); } - function tageditor(selection, newpreset) { + function entityEditor(selection, newpreset) { selection_ = selection; var geometry = entity.geometry(context.graph()); @@ -107,7 +107,7 @@ iD.ui.TagEditor = function(context, entity) { changeTags(); context.history() - .on('change.tag-editor', update); + .on('change.entity-editor', update); } function clean(o) { @@ -129,7 +129,7 @@ iD.ui.TagEditor = function(context, entity) { } } - tageditor.close = function() { + entityEditor.close = function() { // Blur focused element so that tag changes are dispatched // See #1295 document.activeElement.blur(); @@ -139,8 +139,8 @@ iD.ui.TagEditor = function(context, entity) { d3.selectAll('div.typeahead').remove(); context.history() - .on('change.tag-editor', null); + .on('change.entity-editor', null); }; - return d3.rebind(tageditor, event, 'on'); + return d3.rebind(entityEditor, event, 'on'); }; diff --git a/js/id/ui/inspector.js b/js/id/ui/inspector.js index 43498869f..c49f369e9 100644 --- a/js/id/ui/inspector.js +++ b/js/id/ui/inspector.js @@ -1,5 +1,5 @@ iD.ui.Inspector = function(context, entity) { - var tagEditor, + var entityEditor, newFeature = false; function browse() { @@ -40,10 +40,10 @@ iD.ui.Inspector = function(context, entity) { .transition() .style('right', right); - tagLayer.call(tagEditor, preset); + tagLayer.call(entityEditor, preset); }); - tagEditor = iD.ui.TagEditor(context, entity) + entityEditor = iD.ui.EntityEditor(context, entity) .on('close', browse) .on('choose', function(preset) { var right = panewrap.style('right').indexOf('%') > 0 ? @@ -67,7 +67,7 @@ iD.ui.Inspector = function(context, entity) { presetLayer.call(presetList); } else { panewrap.style('right', '-0%'); - tagLayer.call(tagEditor); + tagLayer.call(entityEditor); } if (d3.event) { @@ -86,7 +86,7 @@ iD.ui.Inspector = function(context, entity) { } inspector.close = function(selection) { - tagEditor.close(); + entityEditor.close(); selection.transition() .style('right', '-500px') diff --git a/test/index.html b/test/index.html index 22dc06370..8e6ac24b6 100644 --- a/test/index.html +++ b/test/index.html @@ -90,7 +90,7 @@ - +