From 2c1e598a1e10a319df32556b83ee04c9d6f0bdcb Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Wed, 27 Mar 2013 16:05:33 -0400 Subject: [PATCH] Fix tagreference, fixes #1160 --- css/app.css | 11 +++++++++++ js/id/ui/taglist.js | 22 ++++++++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/css/app.css b/css/app.css index aa14a3bf2..199260fe9 100644 --- a/css/app.css +++ b/css/app.css @@ -1280,6 +1280,17 @@ div.combobox { overflow: hidden; } +.additional-tags div.tag-help { + border-left: 1px solid #ccc; + border-right: 1px solid #ccc; + border-bottom: 1px solid #ccc; + background:#fff; +} + +.additional-tags .tag-help .tag-reference-wrap { + padding: 10px; +} + img.wiki-image { float: left; max-width: 33.3333%; diff --git a/js/id/ui/taglist.js b/js/id/ui/taglist.js index a295e9d76..6b291ca61 100644 --- a/js/id/ui/taglist.js +++ b/js/id/ui/taglist.js @@ -92,19 +92,25 @@ iD.ui.Taglist = function(context, entity) { .attr('tabindex', -1) .attr('class', 'tag-help minor') .on('click', function(tag) { - row.selectAll('div.tag-help') - .style('display', 'none'); - - d3.select(d3.select(this).node().parentNode) - .select('div.tag-help') - .style('display', 'block') - .call(iD.ui.TagReference(entity, {key: tag.key})); + var other = row.selectAll('div.tag-help'), + mine = d3.select(this.parentNode) + .select('div.tag-help'); + if (mine.style('display') === 'none') { + other.style('display', 'none'); + d3.select(this.parentNode) + .select('div.tag-help') + .style('display', 'block') + .call(iD.ui.TagReference(entity, {key: tag.key})); + } else { + mine.style('display', 'none'); + } }) .append('span') .attr('class', 'icon inspect'); row.append('div') - .attr('class', 'tag-help'); + .attr('class', 'tag-help col12') + .style('display', 'none'); return li; }