mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
refactor(client) initModules: simplify key init
This commit is contained in:
parent
d0fdf1686d
commit
e5c33037e5
1 changed files with 2 additions and 14 deletions
|
|
@ -38,7 +38,6 @@ load.addErrorListener((e, src) => {
|
|||
});
|
||||
|
||||
function CloudCmdProto(DOM) {
|
||||
let Key;
|
||||
let Listeners;
|
||||
|
||||
const log = (...a) => {
|
||||
|
|
@ -206,19 +205,8 @@ function CloudCmdProto(DOM) {
|
|||
};
|
||||
|
||||
const initModules = async () => {
|
||||
exec.if(CloudCmd.Key, () => {
|
||||
Key = new CloudCmd.Key();
|
||||
CloudCmd.Key = Key;
|
||||
Key.bind();
|
||||
}, (func) => {
|
||||
/* привязываем клавиши к функциям */
|
||||
const path = 'key.js';
|
||||
|
||||
loadModule({
|
||||
path,
|
||||
func,
|
||||
});
|
||||
});
|
||||
CloudCmd.Key = new CloudCmd.Key();
|
||||
CloudCmd.Key.bind();
|
||||
|
||||
const [, modules] = await tryToCatch(Files.get, 'modules');
|
||||
const showLoad = Images.show.load;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue