This commit is contained in:
John Firebaugh
2013-05-15 16:22:40 -07:00
parent 0d7f38f6c1
commit 701910753c
2 changed files with 7 additions and 13 deletions
-11
View File
@@ -1,17 +1,7 @@
iD.ui.Inspector = function(context, entity) {
var tagEditor,
id = entity.id,
newFeature = false;
function changeTags(tags) {
var entity = context.hasEntity(id);
if (entity && !_.isEqual(entity.tags, tags)) {
context.perform(
iD.actions.ChangeTags(entity.id, tags),
t('operations.change_tags.annotation'));
}
}
function browse() {
context.enter(iD.modes.Browse(context));
}
@@ -54,7 +44,6 @@ iD.ui.Inspector = function(context, entity) {
});
tagEditor = iD.ui.TagEditor(context, entity)
.on('changeTags', changeTags)
.on('close', browse)
.on('choose', function(preset) {
var right = panewrap.style('right').indexOf('%') > 0 ?
+7 -2
View File
@@ -1,5 +1,5 @@
iD.ui.TagEditor = function(context, entity) {
var event = d3.dispatch('changeTags', 'choose', 'close'),
var event = d3.dispatch('choose', 'close'),
presets = context.presets(),
id = entity.id,
tags = _.clone(entity.tags),
@@ -121,7 +121,12 @@ iD.ui.TagEditor = function(context, entity) {
function changeTags(changed) {
tags = clean(_.extend(tags, changed));
event.changeTags(_.clone(tags));
var entity = context.hasEntity(id);
if (entity && !_.isEqual(entity.tags, tags)) {
context.perform(
iD.actions.ChangeTags(entity.id, tags),
t('operations.change_tags.annotation'));
}
}
tageditor.close = function() {