mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(package) supermenu v4.0.1
This commit is contained in:
parent
a9ba166bd4
commit
88d5071400
4 changed files with 21 additions and 15 deletions
|
|
@ -140,6 +140,8 @@ function setMenu(event) {
|
|||
const element = CloudCmd.Edit.getElement();
|
||||
|
||||
Menu = supermenu(element, options, getMenuData());
|
||||
|
||||
Menu.addContextMenuListener();
|
||||
Menu.show(position.x, position.y);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -203,6 +203,8 @@ function setMenu(event) {
|
|||
const element = CloudCmd.Edit.getElement();
|
||||
|
||||
Menu = supermenu(element, options, menuData);
|
||||
|
||||
Menu.addContextMenuListener();
|
||||
Menu.show(position.x, position.y);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,15 +41,17 @@ module.exports.init = () => {
|
|||
menuDataFile,
|
||||
} = getFileMenuData();
|
||||
|
||||
const NOT_FILE = true;
|
||||
const fm = DOM.getFM();
|
||||
const menuData = getMenuData(isAuth);
|
||||
const options = getOptions(NOT_FILE);
|
||||
const optionsFile = getOptions();
|
||||
const options = getOptions({type: 'context'});
|
||||
const optionsFile = getOptions({type: 'file'});
|
||||
|
||||
MenuContext = supermenu(fm, options, menuData);
|
||||
MenuContextFile = supermenu(fm, optionsFile, menuDataFile);
|
||||
|
||||
MenuContext.addContextMenuListener();
|
||||
MenuContextFile.addContextMenuListener();
|
||||
|
||||
Events.addKey(listener);
|
||||
};
|
||||
|
||||
|
|
@ -91,14 +93,14 @@ function getMenuNameByEl(el) {
|
|||
return 'contextFile';
|
||||
}
|
||||
|
||||
function getOptions(notFile) {
|
||||
function getOptions({type}) {
|
||||
let name;
|
||||
let func;
|
||||
|
||||
if (notFile) {
|
||||
if (type === 'context') {
|
||||
name = 'context';
|
||||
func = Key.unsetBind;
|
||||
} else {
|
||||
} else if (type === 'file') {
|
||||
name = 'contextFile';
|
||||
}
|
||||
|
||||
|
|
@ -205,21 +207,21 @@ function beforeShow(callback, params) {
|
|||
});
|
||||
|
||||
const menuName = getMenuNameByEl(el);
|
||||
let notShow = menuName === 'contextFile';
|
||||
|
||||
if (params.name === 'contextFile') {
|
||||
notShow = !notShow;
|
||||
}
|
||||
let isShow = menuName !== 'contextFile';
|
||||
|
||||
if (!notShow)
|
||||
if (params.name === 'contextFile')
|
||||
isShow = !isShow;
|
||||
|
||||
if (isShow)
|
||||
MenuShowedName = name;
|
||||
|
||||
exec(callback);
|
||||
|
||||
if (!notShow)
|
||||
notShow = isPath(params.x, params.y);
|
||||
if (isShow)
|
||||
isShow = isPath(params.x, params.y);
|
||||
|
||||
return notShow;
|
||||
return isShow;
|
||||
}
|
||||
|
||||
function beforeClick(name) {
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@
|
|||
"style-loader": "^1.0.0",
|
||||
"stylelint": "^13.0.0",
|
||||
"stylelint-config-standard": "^20.0.0",
|
||||
"supermenu": "^3.0.0",
|
||||
"supermenu": "^4.0.1",
|
||||
"supertape": "^1.0.3",
|
||||
"tar-stream": "^2.0.0",
|
||||
"unionfs": "^4.0.0",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue