Rename TagEditor -> EntityEditor

It's going to be used to edit relation memberships as well
as tags.
This commit is contained in:
John Firebaugh
2013-05-15 16:38:52 -07:00
parent 701910753c
commit b70b287dee
4 changed files with 14 additions and 14 deletions

View File

@@ -93,7 +93,7 @@
<script src='js/id/ui/zoom.js'></script>
<script src='js/id/ui/taglist.js'></script>
<script src='js/id/ui/preset_list.js'></script>
<script src='js/id/ui/tag_editor.js'></script>
<script src='js/id/ui/entity_editor.js'></script>
<script src='js/id/ui/preset/access.js'></script>
<script src='js/id/ui/preset/address.js'></script>

View File

@@ -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');
};

View File

@@ -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')

View File

@@ -90,7 +90,7 @@
<script src='../js/id/ui/zoom.js'></script>
<script src='../js/id/ui/taglist.js'></script>
<script src='../js/id/ui/preset_list.js'></script>
<script src='../js/id/ui/tag_editor.js'></script>
<script src='../js/id/ui/entity_editor.js'></script>
<script src='../js/id/ui/preset/access.js'></script>
<script src='../js/id/ui/preset/address.js'></script>