feat: consolidate local-first mnote web runtime
This commit is contained in:
@@ -42,6 +42,10 @@ function handleFileTreeKeyDown(event, deps) {
|
||||
|
||||
if (event.key === 'F2') {
|
||||
event.preventDefault();
|
||||
var renameCtx = buildSidebarFileTreeContext('filetree', { targetRow: fileTreeRowForKey });
|
||||
if (!evaluateSidebarFileTreeWhen(renameCtx, '!workspace.readonly && !editor.dirty')) {
|
||||
return true;
|
||||
}
|
||||
beginFileTreeInlineRename(fileTreeRowForKey);
|
||||
return true;
|
||||
}
|
||||
@@ -61,6 +65,10 @@ function handleFileTreeKeyDown(event, deps) {
|
||||
}
|
||||
if (shortcutKey === 'v') {
|
||||
event.preventDefault();
|
||||
var pasteCtx = buildSidebarFileTreeContext('filetree', { targetRow: fileTreeRowForKey });
|
||||
if (!evaluateSidebarFileTreeWhen(pasteCtx, '!workspace.readonly')) {
|
||||
return true;
|
||||
}
|
||||
if (typeof deps.pasteSidebarFileTreeClipboard === 'function') {
|
||||
void deps.pasteSidebarFileTreeClipboard(fileTreeRowForKey);
|
||||
}
|
||||
@@ -70,8 +78,8 @@ function handleFileTreeKeyDown(event, deps) {
|
||||
|
||||
if (event.key === 'Delete' || event.key === 'Backspace') {
|
||||
event.preventDefault();
|
||||
var delCtx = buildSidebarFileTreeContext('filetree');
|
||||
if (!evaluateSidebarFileTreeWhen(delCtx, '!workspace.readonly')) {
|
||||
var delCtx = buildSidebarFileTreeContext('filetree', { targetRow: fileTreeRowForKey });
|
||||
if (!evaluateSidebarFileTreeWhen(delCtx, '!workspace.readonly && !editor.dirty')) {
|
||||
return true;
|
||||
}
|
||||
void deleteSelectedSidebarFileTreeRows(fileTreeRowForKey);
|
||||
|
||||
Reference in New Issue
Block a user