diff --git a/client/modules/view.js b/client/modules/view.js index 4d52969d..60a5b05c 100644 --- a/client/modules/view.js +++ b/client/modules/view.js @@ -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);