diff --git a/client/client.js b/client/client.js index 139dd002..c9f268fe 100644 --- a/client/client.js +++ b/client/client.js @@ -60,6 +60,7 @@ function CloudCmdProto(DOM) { this.prefixURL = ''; this.MIN_ONE_PANEL_WIDTH = 1155; + this.MOBILE_ONE_PANEL_WIDTH = 600; this.HOST = location.origin || location.protocol + '//' + location.host; this.TITLE = 'Cloud Commander'; diff --git a/client/listeners/index.js b/client/listeners/index.js index db927833..cc475794 100644 --- a/client/listeners/index.js +++ b/client/listeners/index.js @@ -55,7 +55,7 @@ const {Events} = DOM; const EventsFiles = { mousedown: exec.with(execIfNotUL, setCurrentFileByEvent), - click: execAll([onClick, unselect]), + click: execAll([onClick, exec.with(execIfNotMobile, unselect)]), dragstart: exec.with(execIfNotUL, onDragStart), dblclick: exec.with(execIfNotUL, onDblClick), touchstart: exec.with(execIfNotUL, onTouch), @@ -221,6 +221,12 @@ function copyPath(el) { .catch(CloudCmd.log); } +function execIfNotMobile(callback , event) +{ + if (window.innerWidth > CloudCmd.MOBILE_ONE_PANEL_WIDTH) + callback(event); +} + function execIfNotUL(callback, event) { const {target} = event; const {tagName} = target;