mirror of
https://github.com/zadam/trilium.git
synced 2025-12-23 15:54:25 +01:00
chore(breadcrumb): address requested changes
This commit is contained in:
parent
7e07280eb3
commit
8c008e2e3a
@ -335,7 +335,7 @@ export function goToLinkExt(evt: MouseEvent | JQuery.ClickEvent | JQuery.MouseDo
|
|||||||
window.open(hrefLink, "_blank");
|
window.open(hrefLink, "_blank");
|
||||||
} else {
|
} else {
|
||||||
// Enable protocols supported by CKEditor 5 to be clickable.
|
// Enable protocols supported by CKEditor 5 to be clickable.
|
||||||
if (ALLOWED_PROTOCOLS.some((protocol) => hrefLink.toLowerCase().startsWith(`${protocol }:`))) {
|
if (ALLOWED_PROTOCOLS.some((protocol) => hrefLink.toLowerCase().startsWith(`${protocol}:`))) {
|
||||||
if ( utils.isElectron()) {
|
if ( utils.isElectron()) {
|
||||||
const electron = utils.dynamicRequire("electron");
|
const electron = utils.dynamicRequire("electron");
|
||||||
electron.shell.openExternal(hrefLink);
|
electron.shell.openExternal(hrefLink);
|
||||||
|
|||||||
@ -313,11 +313,11 @@ function buildContextMenu(notePath: string, parentComponent: Component | null) {
|
|||||||
const note = await branch?.getNote();
|
const note = await branch?.getNote();
|
||||||
if (!note) return;
|
if (!note) return;
|
||||||
|
|
||||||
const notSearch = note?.type !== "search";
|
const notSearch = note.type !== "search";
|
||||||
const notOptionsOrHelp = !note?.noteId.startsWith("_options") && !note?.noteId.startsWith("_help");
|
const notOptionsOrHelp = !note.noteId.startsWith("_options") && !note.noteId.startsWith("_help");
|
||||||
const isArchived = note.isArchived;
|
const isArchived = note.isArchived;
|
||||||
const isNotRoot = note?.noteId !== "root";
|
const isNotRoot = note.noteId !== "root";
|
||||||
const isHoisted = note?.noteId === appContext.tabManager.getActiveContext()?.hoistedNoteId;
|
const isHoisted = note.noteId === appContext.tabManager.getActiveContext()?.hoistedNoteId;
|
||||||
const parentNote = isNotRoot && branch ? await froca.getNote(branch.parentNoteId) : null;
|
const parentNote = isNotRoot && branch ? await froca.getNote(branch.parentNoteId) : null;
|
||||||
const parentNotSearch = !parentNote || parentNote.type !== "search";
|
const parentNotSearch = !parentNote || parentNote.type !== "search";
|
||||||
|
|
||||||
@ -369,7 +369,7 @@ function buildContextMenu(notePath: string, parentComponent: Component | null) {
|
|||||||
enabled: isNotRoot && !isHoisted && parentNotSearch && notOptionsOrHelp,
|
enabled: isNotRoot && !isHoisted && parentNotSearch && notOptionsOrHelp,
|
||||||
handler: () => branches.deleteNotes([ branchId ])
|
handler: () => branches.deleteNotes([ branchId ])
|
||||||
},
|
},
|
||||||
{ kind: "separator"},
|
{ kind: "separator" },
|
||||||
(notOptionsOrHelp ? {
|
(notOptionsOrHelp ? {
|
||||||
kind: "custom",
|
kind: "custom",
|
||||||
componentFn: () => {
|
componentFn: () => {
|
||||||
@ -396,7 +396,7 @@ function buildContextMenu(notePath: string, parentComponent: Component | null) {
|
|||||||
x: e.pageX,
|
x: e.pageX,
|
||||||
y: e.pageY,
|
y: e.pageY,
|
||||||
selectMenuItemHandler: ({ command }) => {
|
selectMenuItemHandler: ({ command }) => {
|
||||||
if (link_context_menu.handleLinkContextMenuItem(command, e, note.noteId)) {
|
if (link_context_menu.handleLinkContextMenuItem(command, e, notePath)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user