add shortcut key to go up directory level

This commit is contained in:
Bao Nguyen
2023-02-14 16:08:52 +07:00
parent 68d7d4a394
commit 0cc49ab7cc
5 changed files with 22 additions and 9 deletions

View File

@@ -38,7 +38,7 @@
} else if(type == 'RecycleBin'){
menu_obj = (await import('./context_menu/RecycleBin')).make({type, originator});
} else {
console.log('unknown context menu type')
}

View File

@@ -224,7 +224,7 @@
page_index = Math.min(history.length - 1, page_index + 1);
}
function up(){
export function up(){
let parent_id = $hardDrive[history[page_index]].parent;
open(parent_id);
}

View File

@@ -172,11 +172,11 @@
}
function on_keydown(e){
console.log('keyevent in my computer');
if(my_computer_instance.window.z_index != $zIndex) return;
if(renaming) return;
if(id == null) return;
console.log('not skip');
console.log('keyevent in my computer');
if(!(e.ctrlKey || e.metaKey)) return;
if(e.key == 'c'){
@@ -188,6 +188,10 @@
} else if(e.key == 'a'){
let els = node_ref.querySelectorAll('.fs-item');
ds.setSelection(els, true);
} else if(e.key == 'ArrowUp'){
e.preventDefault();
my_computer_instance.up();
}
}