fix for icon change when creating note / changing type/mime

This commit is contained in:
azivner
2018-01-28 10:37:43 -05:00
parent 7ca0445bae
commit e8f8341ef9
6 changed files with 29 additions and 18 deletions

View File

@@ -150,12 +150,12 @@ const noteEditor = (function() {
noteDetailEl.show();
noteDetailCodeEl.hide();
noteDetailRenderEl.hide();
noteDetailRenderEl.html('').hide();
}
else if (currentNote.detail.type === 'code') {
noteDetailEl.hide();
noteDetailCodeEl.show();
noteDetailRenderEl.hide();
noteDetailRenderEl.html('').hide();
// this needs to happen after the element is shown, otherwise the editor won't be refresheds
codeEditor.setValue(currentNote.detail.note_text);
@@ -170,7 +170,7 @@ const noteEditor = (function() {
else if (currentNote.detail.type === 'render') {
noteDetailEl.hide();
noteDetailCodeEl.hide();
noteDetailRenderEl.show();
noteDetailRenderEl.html('').show();
const subTree = await server.get('script/subtree/' + getCurrentNoteId());

View File

@@ -756,16 +756,6 @@ const noteTree = (function() {
is_protected: isProtected
});
const newNode = {
title: newNoteName,
note_id: result.note_id,
parent_note_id: parentNoteId,
refKey: result.note_id,
note_tree_id: result.note_tree_id,
is_protected: isProtected,
extraClasses: isProtected ? "protected" : ""
};
setParentChildRelation(result.note_tree_id, parentNoteId, result.note_id);
notesTreeMap[result.note_tree_id] = result;
@@ -774,6 +764,16 @@ const noteTree = (function() {
noteEditor.newNoteCreated();
const newNode = {
title: newNoteName,
note_id: result.note_id,
parent_note_id: parentNoteId,
refKey: result.note_id,
note_tree_id: result.note_tree_id,
is_protected: isProtected,
extraClasses: getExtraClasses(result.note)
};
if (target === 'after') {
node.appendSibling(newNode).setActive(true);
}

View File

@@ -79,6 +79,9 @@ const noteType = (function() {
await noteEditor.reload();
// for the note icon to be updated in the tree
await noteTree.reload();
self.updateExecuteScriptButtonVisibility();
}