feature(cloudcmd) view file on double click or enter

This commit is contained in:
Max_ 2019-02-15 12:04:11 +03:00 committed by coderaiser
parent 648997851c
commit e32e3ff47d
3 changed files with 21 additions and 11 deletions

View file

@ -194,7 +194,8 @@ Hot keys
| `Ctrl + F3` | sort by name
| `Ctrl + F5` | sort by date
| `Ctrl + F6` | sort by size
| `Up`, `Down`, `Enter` | file system navigation
| `Up`, `Down` | file system navigation
| `Enter` | change directory/view file
| `Alt + Left/Right` | show content of directory under cursor in target panel
| `Alt + G` | go to directory
| `Ctrl + \` | go to the root directory

View file

@ -387,6 +387,8 @@ function KeyProto() {
case Key.ENTER:
if (Info.isDir)
loadDir({path});
else
CloudCmd.View.show();
break;
case Key.BACKSPACE:

View file

@ -274,6 +274,10 @@ function onDblClick(event) {
path: path === '/' ? '/' : path + '/',
});
event.preventDefault();
}else{
CloudCmd.View.show();
event.preventDefault();
}
}
@ -282,17 +286,20 @@ function onTouch(event) {
const current = getLIElement(event.target);
const isDir = DOM.isCurrentIsDir(current);
if (!isDir)
return;
if (!isDir){
const isCurrent = DOM.isCurrentFile(current);
if (!isCurrent)
return;
CloudCmd.loadDir({
path: DOM.getCurrentPath(current),
});
const isCurrent = DOM.isCurrentFile(current);
if (!isCurrent)
return;
CloudCmd.loadDir({
path: DOM.getCurrentPath(current),
});
}else{
CloudCmd.View.show();
}
}
/*