mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 01:47:35 +00:00
refactor(view) setCurrentByPosition
This commit is contained in:
parent
a088a6718e
commit
b676c67b96
1 changed files with 9 additions and 2 deletions
|
|
@ -346,8 +346,6 @@ function loadAll(callback) {
|
|||
}
|
||||
|
||||
function onOverLayClick(event) {
|
||||
const files = Info.files;
|
||||
const filesPassive = Info.filesPassive;
|
||||
const {target} = event;
|
||||
const isOverlay = target === Overlay;
|
||||
const position = {
|
||||
|
|
@ -361,11 +359,20 @@ function onOverLayClick(event) {
|
|||
hideOverlay();
|
||||
hide();
|
||||
|
||||
setCurrentByPosition(position);
|
||||
}
|
||||
|
||||
function setCurrentByPosition(position) {
|
||||
const element = DOM.getCurrentByPosition(position);
|
||||
|
||||
if (!element)
|
||||
return;
|
||||
|
||||
const {
|
||||
files,
|
||||
filesPassive,
|
||||
} = Info.files;
|
||||
|
||||
const isFiles = ~files.indexOf(element);
|
||||
const isFilesPassive = ~filesPassive.indexOf(element);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue