mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 01:17:18 +00:00
fix(menu) set key bind when close
This commit is contained in:
parent
fcf8c0c492
commit
794e9412b6
1 changed files with 15 additions and 11 deletions
|
|
@ -33,7 +33,7 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
Menu.show
|
||||
]);
|
||||
|
||||
Events.addKey( lListener );
|
||||
Events.addKey(listener);
|
||||
}
|
||||
|
||||
this.show = function() {
|
||||
|
|
@ -215,6 +215,8 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
|
||||
if (!event || !event.keyCode)
|
||||
clickProcessing();
|
||||
else if (event.keyCode)
|
||||
listener(event);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -317,18 +319,20 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
}
|
||||
}
|
||||
|
||||
function lListener(pEvent) {
|
||||
var lCurrent,
|
||||
lF9 = Key.F9,
|
||||
lKey = pEvent.keyCode,
|
||||
lIsBind = Key.isBind();
|
||||
function listener(event) {
|
||||
var current,
|
||||
F9 = Key.F9,
|
||||
ESC = Key.ESC,
|
||||
key = event.keyCode,
|
||||
isBind = Key.isBind();
|
||||
|
||||
if (lIsBind && lKey === lF9) {
|
||||
lCurrent = DOM.getCurrentFile();
|
||||
$(lCurrent).contextmenu();
|
||||
if (isBind && key === F9) {
|
||||
current = DOM.getCurrentFile();
|
||||
$(current).contextmenu();
|
||||
|
||||
DOM.preventDefault(pEvent);
|
||||
}
|
||||
DOM.preventDefault(event);
|
||||
} else if (key === ESC)
|
||||
Key.setBind();
|
||||
}
|
||||
|
||||
init();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue