mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-05 22:46:38 +02:00
Add thread dots to note header icon, disable comments on closed nodes
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user