reduce unnecessary html injection

This commit is contained in:
Martin Raifer
2024-04-24 13:53:43 +02:00
parent 42691dec9d
commit fc4e05601a

View File

@@ -148,8 +148,13 @@ export function uiNoteEditor(context) {
noteSaveEnter
.append('h4')
.attr('class', '.note-save-header')
.html(function() {
return _note.isNew() ? t.html('note.newDescription') : t.html('note.newComment');
.text('')
.each(function() {
if (_note.isNew()) {
t.append('note.newDescription')(d3_select(this));
} else {
t.append('note.newComment')(d3_select(this));
}
});
var commentTextarea = noteSaveEnter
@@ -366,10 +371,11 @@ export function uiNoteEditor(context) {
buttonSection.select('.status-button') // select and propagate data
.attr('disabled', (hasAuth ? null : true))
.html(function(d) {
.text('')
.each(function(d) {
var action = (d.status === 'open' ? 'close' : 'open');
var andComment = (d.newComment ? '_comment' : '');
return t.html('note.' + action + andComment);
t.append('note.' + action + andComment)(d3_select(this));
});
buttonSection.select('.status-button')
.on('click.status', clickStatus);