some fixes for CKEditor

This commit is contained in:
azivner
2017-12-02 13:54:16 -05:00
parent a85bb649cb
commit 7b6ccab894
4 changed files with 30 additions and 19 deletions

View File

@@ -82,12 +82,12 @@ const noteEditor = (function() {
function setNoteBackgroundIfProtected(note) {
if (note.detail.is_protected) {
$(".note-editable").addClass("protected");
$("#note-detail").addClass("protected");
protectButton.hide();
unprotectButton.show();
}
else {
$(".note-editable").removeClass("protected");
$("#note-detail").removeClass("protected");
protectButton.show();
unprotectButton.hide();
}
@@ -126,9 +126,6 @@ const noteEditor = (function() {
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');
editor.setData(currentNote.detail.note_text);
noteChangeDisabled = false;
@@ -142,6 +139,10 @@ const noteEditor = (function() {
return await server.get('notes/' + noteId);
}
function getEditor() {
return editor;
}
$(document).ready(() => {
noteTitleEl.on('input', () => {
noteChanged();
@@ -179,6 +180,7 @@ const noteEditor = (function() {
loadNote,
getCurrentNote,
getCurrentNoteId,
newNoteCreated
newNoteCreated,
getEditor
};
})();