From e8fc9f2edad1fc2c8f3a88378d908c3db5cbf414 Mon Sep 17 00:00:00 2001 From: Thomas Hervey Date: Sat, 21 Jul 2018 12:31:22 -0400 Subject: [PATCH] simplify save buttons --- modules/ui/note_editor.js | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/modules/ui/note_editor.js b/modules/ui/note_editor.js index 10c78ab9e..2a50f8891 100644 --- a/modules/ui/note_editor.js +++ b/modules/ui/note_editor.js @@ -256,19 +256,15 @@ export function uiNoteEditor(context) { .append('div') .attr('class', 'buttons'); - if (_note.isNew()) { - buttonEnter - .append('button') - .attr('class', 'button add-note-button action') - .append('span') - .attr('class', 'label'); - } else { - buttonEnter - .append('button') - .attr('class', 'button status-button action') - .append('span') - .attr('class', 'label'); + buttonEnter + .append('button') + .attr('class', function() { + return _note.isNew() ? 'button add-note-button action' : 'button status-button action'; + }) + .append('span') + .attr('class', 'label'); + if (!_note.isNew()) { buttonEnter .append('button') .attr('class', 'button comment-button action')