Skip to content

Commit

Permalink
Add thread dots to the note header icon too
Browse files Browse the repository at this point in the history
  • Loading branch information
bhousel committed Jul 16, 2018
1 parent 47de7b3 commit d6825f0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
13 changes: 13 additions & 0 deletions css/65_data.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@
top: 18px;
}

.note-header-icon .note-icon-annotation {
position: absolute;
top: 21px;
left: 21px;
margin: auto;
}

.note-header-icon .note-icon-annotation .icon {
width: 18px;
height: 18px;
}


/* OSM Note UI */
.note-header {
background-color: #f6f6f6;
Expand Down
2 changes: 1 addition & 1 deletion modules/svg/notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function svgNotes(projection, context, dispatch) {
.attr('xlink:href', '#iD-icon-note');

// add dots if there's a comment thread
notesEnter.selectAll('.thread')
notesEnter.selectAll('.note-annotation')
.data(function(d) { return d.comments.length > 1 ? [0] : []; })
.enter()
.append('use')
Expand Down
2 changes: 1 addition & 1 deletion modules/ui/note_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export function uiNoteEditor(context) {

buttonSection.select('.comment-button') // select and propagate data
.attr('disabled', function(d) {
return d.newComment ? null : true;
return (d.status === 'open' && d.newComment) ? null : true;
})
.on('click.save', function(d) {
this.blur(); // avoid keeping focus on the button - #4641
Expand Down
14 changes: 13 additions & 1 deletion modules/ui/note_header.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ export function uiNoteHeader() {

function noteHeader(selection) {
var header = selection.selectAll('.note-header')
.data([_note], function(d) { return d.status + d.id; });
.data(
(_note ? [_note] : []),
function(d) { return d.status + d.id; }
);

header.exit()
.remove();
Expand All @@ -26,6 +29,15 @@ export function uiNoteHeader() {
.attr('class', 'preset-icon-28')
.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'));
}
})

headerEnter
.append('div')
.attr('class', 'note-header-label')
Expand Down

0 comments on commit d6825f0

Please sign in to comment.