update note title in tree real time instead of waiting for save event

This commit is contained in:
azivner 2017-11-29 21:13:12 -05:00
parent e6629b2c93
commit 69f77ac439

View file

@ -119,10 +119,10 @@ const noteEditor = (function() {
noteDetailWrapperEl.show();
noteTitleEl.val(currentNote.detail.note_title);
noteChangeDisabled = true;
noteTitleEl.val(currentNote.detail.note_title);
// Clear contents and remove all stored history. This is to prevent undo from going across notes
noteDetailEl.summernote('reset');
@ -140,7 +140,13 @@ const noteEditor = (function() {
}
$(document).ready(() => {
noteTitleEl.on('input', noteChanged);
noteTitleEl.on('input', () => {
noteChanged();
const title = noteTitleEl.val();
noteTree.setNoteTitle(getCurrentNoteId(), title);
});
noteDetailEl.summernote({
airMode: true,