mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
feature(listeners) rm onContextMenu
This commit is contained in:
parent
da7f8fc7f9
commit
b210a784e1
1 changed files with 12 additions and 24 deletions
|
|
@ -10,12 +10,11 @@ var Util, DOM, CloudFunc, CloudCmd;
|
|||
Storage = DOM.Storage,
|
||||
Events = DOM.Events,
|
||||
EventsFiles = {
|
||||
'mousedown' : Util.exec.with(execIfNotUL, setCurrentFileByEvent),
|
||||
'contextmenu' : onContextMenu,
|
||||
'click' : onClick,
|
||||
'dragstart' : Util.exec.with(execIfNotUL, onDragStart),
|
||||
'dblclick' : Util.exec.with(execIfNotUL, onDblClick),
|
||||
'touchstart' : Util.exec.with(execIfNotUL, onTouch)
|
||||
'mousedown' : Util.exec.with(execIfNotUL, setCurrentFileByEvent),
|
||||
'click' : onClick,
|
||||
'dragstart' : Util.exec.with(execIfNotUL, onDragStart),
|
||||
'dblclick' : Util.exec.with(execIfNotUL, onDblClick),
|
||||
'touchstart': Util.exec.with(execIfNotUL, onTouch)
|
||||
};
|
||||
|
||||
this.init = function () {
|
||||
|
|
@ -170,24 +169,6 @@ var Util, DOM, CloudFunc, CloudCmd;
|
|||
}
|
||||
}
|
||||
|
||||
function onContextMenu(event) {
|
||||
var element = event.target,
|
||||
tag = element.tagName,
|
||||
isUL = tag === 'UL';
|
||||
|
||||
if (!isUL) {
|
||||
element = getLIElement(event.target);
|
||||
DOM.setCurrentFile(element);
|
||||
}
|
||||
|
||||
Util.exec(CloudCmd.Menu, {
|
||||
x: event.clientX,
|
||||
y: event.clientY
|
||||
});
|
||||
|
||||
changePanel(element);
|
||||
}
|
||||
|
||||
/*
|
||||
* download file from browser to desktop
|
||||
* in Chrome (HTML5)
|
||||
|
|
@ -232,6 +213,13 @@ var Util, DOM, CloudFunc, CloudCmd;
|
|||
}
|
||||
|
||||
function contextMenu() {
|
||||
Events.addOnce('contextmenu', DOM.getFM(), function() {
|
||||
CloudCmd.Menu.show({
|
||||
x: event.clientX,
|
||||
y: event.clientY
|
||||
});
|
||||
});
|
||||
|
||||
Events.addContextMenu(document, function(event) {
|
||||
CloudCmd.Menu.ENABLED || event.preventDefault();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue