From 317090be12dad612f3856ba0392c468153773be0 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 21 Mar 2013 14:47:07 -0700 Subject: [PATCH] `preset` is always present --- js/id/ui/tag_editor.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/js/id/ui/tag_editor.js b/js/id/ui/tag_editor.js index 8b3f101d7..737680c0d 100644 --- a/js/id/ui/tag_editor.js +++ b/js/id/ui/tag_editor.js @@ -17,7 +17,6 @@ iD.ui.TagEditor = function(context, entity) { // preset was explicitly chosen if (newpreset) { - tags = preset.removeTags(tags, geometry); newpreset.applyTags(tags, geometry); @@ -40,7 +39,7 @@ iD.ui.TagEditor = function(context, entity) { back.append('div') .attr('class', 'col12') .append('span') - .attr('class', 'preset-icon icon' + (preset ? ' feature-' + (preset.icon || fallbackIcon) : '')); + .attr('class', 'preset-icon icon feature-' + (preset.icon || fallbackIcon)); back.append('div') .attr('class', 'col12') @@ -77,6 +76,7 @@ iD.ui.TagEditor = function(context, entity) { presetUI = iD.ui.preset(context) .entity(entity) + .preset(preset) .on('change', changeTags) .on('close', event.close); @@ -84,12 +84,8 @@ iD.ui.TagEditor = function(context, entity) { .on('change', changeTags); var tageditorpreset = editorwrap.append('div') - .attr('class', 'inspector-preset cf fillL col12'); - - if (preset) { - tageditorpreset.call(presetUI - .preset(preset)); - } + .attr('class', 'inspector-preset cf fillL col12') + .call(presetUI); editorwrap.append('div') .attr('class','inspector-inner col12 fillL2 additional-tags')