mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 20:06:08 +01:00
fix for icon change when creating note / changing type/mime
This commit is contained in:
@@ -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());
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user