mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
feature: cloudcmd: prevent unselect being fired on panel click when in mobile view (#422)
* Prevent unselect being fired on panel click when in mobile view * Prevent unselect being fired on panel click when in mobile view after review --------- Co-authored-by: hagaygo <hagay@WORKROOM>
This commit is contained in:
parent
1a0af863a2
commit
f22120dc38
2 changed files with 8 additions and 1 deletions
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue