From 00bb7337369e8cacb13a54c2f547f76b80ea7e6a Mon Sep 17 00:00:00 2001 From: Thomas Hervey Date: Sat, 21 Jul 2018 22:49:12 -0400 Subject: [PATCH] changed note annotation icons --- modules/svg/notes.js | 20 +++++--------------- modules/ui/note_header.js | 16 +++++----------- 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/modules/svg/notes.js b/modules/svg/notes.js index 29c05194b..f516922c9 100644 --- a/modules/svg/notes.js +++ b/modules/svg/notes.js @@ -124,27 +124,17 @@ export function svgNotes(projection, context, dispatch) { // add dots if there's a comment thread notesEnter.selectAll('.note-annotation') - .data(function(d) { return d.comments.length > 1 ? [0] : []; }) + .data(function(d) { return [d]; }) .enter() .append('use') .attr('class', 'note-annotation thread') .attr('width', '14px') .attr('height', '14px') .attr('x', '-5px') - .attr('y', '-20px') - .attr('xlink:href', '#iD-icon-more'); - - // add plus if this is a new note - notesEnter.selectAll('.note-annotation') - .data(function(d) { return d.id < 0 ? [0] : []; }) - .enter() - .append('use') - .attr('class', 'note-annotation thread') - .attr('width', '14px') - .attr('height', '14px') - .attr('x', '-5px') - .attr('y', '-20px') - .attr('xlink:href', '#iD-icon-plus'); + .attr('y', '-21px') + .attr('xlink:href', function(d) { + return '#iD-icon-' + (d.id < 0 ? 'plus' : (d.status === 'open' ? 'close' : 'apply')); + }); // update notes diff --git a/modules/ui/note_header.js b/modules/ui/note_header.js index e2bb1af66..8fc2a0e95 100644 --- a/modules/ui/note_header.js +++ b/modules/ui/note_header.js @@ -31,17 +31,11 @@ export function uiNoteHeader() { .call(svgIcon('#iD-icon-note', 'note-fill')); iconEnter.each(function(d) { - if (d.comments.length > 1) { - iconEnter - .append('div') - .attr('class', 'note-icon-annotation') - .call(svgIcon('#iD-icon-more', 'note-annotation')); - } else if (_note.isNew()) { - iconEnter - .append('div') - .attr('class', 'note-icon-annotation') - .call(svgIcon('#iD-icon-plus', 'note-annotation')); - } + var statusIcon = '#iD-icon-' + (d.id < 0 ? 'plus' : (d.status === 'open' ? 'close' : 'apply')); + iconEnter + .append('div') + .attr('class', 'note-icon-annotation') + .call(svgIcon(statusIcon, 'note-annotation')); }); headerEnter