mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(edit) setMenu
This commit is contained in:
parent
e8c7ffa909
commit
a4f0c52db3
1 changed files with 3 additions and 6 deletions
|
|
@ -49,7 +49,6 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip, MenuI
|
|||
|
||||
this.show = function(value) {
|
||||
var mode, htmlMode, jsMode, isHTML, isJS, modesByName,
|
||||
onMenu,
|
||||
isStr = Util.isString(value),
|
||||
name = Info.name,
|
||||
isDir = Info.isDir;
|
||||
|
|
@ -68,11 +67,9 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip, MenuI
|
|||
notAppend : true
|
||||
});
|
||||
|
||||
onMenu = Util.exec.with(setMenu, Element);
|
||||
|
||||
initAce();
|
||||
|
||||
Events.addOnce('contextmenu', Element, onMenu)
|
||||
Events.addOnce('contextmenu', Element, setMenu)
|
||||
.add(Element, {
|
||||
drop : onDrop,
|
||||
dragover : DOM.preventDefault
|
||||
|
|
@ -372,7 +369,7 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip, MenuI
|
|||
});
|
||||
}
|
||||
|
||||
function setMenu(element) {
|
||||
function setMenu() {
|
||||
DOM.loadMenu(function() {
|
||||
var position = CloudCmd.MousePosition,
|
||||
options = {
|
||||
|
|
@ -398,7 +395,7 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip, MenuI
|
|||
'Close Esc' : Edit.hide
|
||||
};
|
||||
|
||||
Menu = new MenuIO(element, options, menuData);
|
||||
Menu = new MenuIO(Element, options, menuData);
|
||||
|
||||
Menu.show(position.x, position.y);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue