added note alphabetical sorting to context menu

This commit is contained in:
azivner
2018-01-13 17:00:40 -05:00
parent a375c55371
commit 4f649c2e21
3 changed files with 47 additions and 2 deletions

View File

@@ -90,7 +90,9 @@ const contextMenu = (function() {
{title: "Paste after", cmd: "pasteAfter", uiIcon: "ui-icon-clipboard"},
{title: "----"},
{title: "Collapse sub-tree <kbd>Alt+-</kbd>", cmd: "collapse-sub-tree", uiIcon: "ui-icon-minus"},
{title: "Force note sync", cmd: "force-note-sync", uiIcon: "ui-icon-refresh"}
{title: "Force note sync", cmd: "force-note-sync", uiIcon: "ui-icon-refresh"},
{title: "Sort alphabetically", cmd: "sort-alphabetically", uiIcon: " ui-icon-arrowthick-2-n-s"}
],
beforeOpen: (event, ui) => {
const node = $.ui.fancytree.getNode(ui.target);
@@ -147,6 +149,9 @@ const contextMenu = (function() {
else if (ui.cmd === "force-note-sync") {
forceNoteSync(node.data.note_id);
}
else if (ui.cmd === "sort-alphabetically") {
noteTree.sortAlphabetically(node.data.note_id);
}
else {
messaging.logError("Unknown command: " + ui.cmd);
}