update checking if note is new

This commit is contained in:
Thomas Hervey
2018-07-18 17:11:17 -04:00
parent 87615c56c4
commit 438756103d
4 changed files with 7 additions and 8 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ export function modeSelectNote(context, selectedNoteID) {
.call(keybinding);
context.ui().sidebar
.show(noteEditor.note(note, newFeature));
.show(noteEditor.note(note));
context.map()
.on('drawn.select', selectNote);
+1 -1
View File
@@ -11,7 +11,7 @@ export function uiNoteComments() {
function noteComments(selection) {
if (_note.newFeature) { return; }
if (_note.isNew()) { return; }
var comments = selection.selectAll('.comments-container')
.data([0]);
+3 -4
View File
@@ -91,7 +91,7 @@ export function uiNoteEditor(context) {
.append('h4')
.attr('class', '.note-save-header')
.text(function() {
return _note.newFeature ? t('note.newDescription') : t('note.newComment');
return _note.isNew() ? t('note.newDescription') : t('note.newComment');
});
noteSaveEnter
@@ -142,7 +142,7 @@ export function uiNoteEditor(context) {
.append('div')
.attr('class', 'buttons');
if (_note.newFeature) {
if (_note.isNew()) {
buttonEnter
.append('button')
.attr('class', 'button add-note-button action')
@@ -215,10 +215,9 @@ export function uiNoteEditor(context) {
}
noteEditor.note = function(_, __) {
noteEditor.note = function(_) {
if (!arguments.length) return _note;
_note = _;
_note.update({ newFeature: __ });
return noteEditor;
};
+2 -2
View File
@@ -36,7 +36,7 @@ export function uiNoteHeader() {
.append('div')
.attr('class', 'note-icon-annotation')
.call(svgIcon('#iD-icon-more', 'note-annotation'));
} else if (_note.newFeature) {
} else if (_note.isNew()) {
iconEnter
.append('div')
.attr('class', 'note-icon-annotation')
@@ -48,7 +48,7 @@ export function uiNoteHeader() {
.append('div')
.attr('class', 'note-header-label')
.text(function(d) {
if (_note.newFeature) { return t('note.new'); }
if (_note.isNew()) { return t('note.new'); }
return t('note.note') + ' ' + d.id + ' ' +
(d.status === 'closed' ? t('note.closed') : '');
});