From 56a8407767066607882fd2569667116d42f96ba7 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 22 May 2013 10:33:47 -0700 Subject: [PATCH] Tag reference doesn't need to be exclusive This makes the implementation more complex and the feature is of marginal benefit, possibly detrimental. (What if I want to compare two tags and figure out which one is more appropriate?) --- js/id/ui/preset.js | 8 +------- js/id/ui/taglist.js | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/js/id/ui/preset.js b/js/id/ui/preset.js index 37a10f3df..7f84103ce 100644 --- a/js/id/ui/preset.js +++ b/js/id/ui/preset.js @@ -85,13 +85,7 @@ iD.ui.preset = function(context, entity, preset) { d3.event.stopPropagation(); d3.event.preventDefault(); - _.forEach(shown(), function(other) { - if (other.id === field.id) { - other.reference.toggle(); - } else { - other.reference.hide(); - } - }); + field.reference.toggle(); render(); } diff --git a/js/id/ui/taglist.js b/js/id/ui/taglist.js index dc100d7d1..0230382d7 100644 --- a/js/id/ui/taglist.js +++ b/js/id/ui/taglist.js @@ -102,13 +102,7 @@ iD.ui.Taglist = function(context, entity) { row.call(iD.ui.TagReferenceButton() .on('click', function(tag) { - tags.forEach(function(other) { - if (other.key === tag.key) { - other.reference.toggle(); - } else { - other.reference.hide(); - } - }); + tag.reference.toggle(); })); row.each(function(tag) {