diff --git a/src/public/app/dialogs/sort_child_notes.js b/src/public/app/dialogs/sort_child_notes.js new file mode 100644 index 000000000..0357dcd2b --- /dev/null +++ b/src/public/app/dialogs/sort_child_notes.js @@ -0,0 +1,8 @@ +import server from "../services/server.js"; +import utils from "../services/utils.js"; + +const $dialog = $("#sort-child-notes-dialog"); + +export async function showDialog() { + utils.openDialog($dialog); +} diff --git a/src/public/app/services/tree_context_menu.js b/src/public/app/services/tree_context_menu.js index d8ceb5028..8d39e9c5b 100644 --- a/src/public/app/services/tree_context_menu.js +++ b/src/public/app/services/tree_context_menu.js @@ -75,7 +75,7 @@ class TreeContextMenu { { title: 'Expand subtree ', command: "expandSubtree", uiIcon: "expand", enabled: noSelectedNotes }, { title: 'Collapse subtree ', command: "collapseSubtree", uiIcon: "collapse", enabled: noSelectedNotes }, { title: "Force note sync", command: "forceNoteSync", uiIcon: "refresh", enabled: noSelectedNotes }, - { title: 'Sort alphabetically ', command: "sortChildNotes", uiIcon: "empty", enabled: noSelectedNotes && notSearch }, + { title: 'Sort by ... ', command: "sortChildNotes", uiIcon: "empty", enabled: noSelectedNotes && notSearch }, { title: 'Recent changes in subtree', command: "recentChangesInSubtree", uiIcon: "history", enabled: noSelectedNotes } ] }, { title: "----" }, diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.js index 75e34d904..cd04c0301 100644 --- a/src/public/app/widgets/note_tree.js +++ b/src/public/app/widgets/note_tree.js @@ -1370,7 +1370,7 @@ export default class NoteTreeWidget extends TabAwareWidget { } sortChildNotesCommand({node}) { - treeService.sortAlphabetically(node.data.noteId); + import("../dialogs/sort_child_notes.js").then(d => d.showDialog(node)); } async recentChangesInSubtreeCommand({node}) { diff --git a/src/views/desktop.ejs b/src/views/desktop.ejs index 4823a894a..3b87be91a 100644 --- a/src/views/desktop.ejs +++ b/src/views/desktop.ejs @@ -39,6 +39,7 @@ <%- include('dialogs/move_to.ejs') %> <%- include('dialogs/backend_log.ejs') %> <%- include('dialogs/include_note.ejs') %> +<%- include('dialogs/sort_child_notes.ejs') %>