diff --git a/js/id/ui/inspector.js b/js/id/ui/inspector.js index dad764670..43498869f 100644 --- a/js/id/ui/inspector.js +++ b/js/id/ui/inspector.js @@ -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 ? diff --git a/js/id/ui/tag_editor.js b/js/id/ui/tag_editor.js index 504bd44f9..9c7f9db5a 100644 --- a/js/id/ui/tag_editor.js +++ b/js/id/ui/tag_editor.js @@ -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() {