Update BDFDB.max.js
This commit is contained in:
parent
2312e58d74
commit
3956eb782a
|
@ -1645,6 +1645,11 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
|
|||
}
|
||||
}});
|
||||
BDFDB.WebModules.patch(module.prototype, 'render', BDFDB, {after: e => {
|
||||
if (e.thisObject.props.BDFDBcontextMenu && e.thisObject.props.children && e.returnValue && e.returnValue.props) {
|
||||
e.returnValue.props.children = e.thisObject.props.children;
|
||||
delete e.thisObject.props.children;
|
||||
delete e.thisObject.props.BDFDBcontextMenu;
|
||||
}
|
||||
if (BDFDB.React.findDOMNodeSafe(e.thisObject)) {
|
||||
e.thisObject.BDFDBforceRenderTimeout = true;
|
||||
setTimeout(() => {delete e.thisObject.BDFDBforceRenderTimeout;}, 1000);
|
||||
|
@ -3275,6 +3280,18 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
|
|||
return names.some(name => displayname == name || label == name);
|
||||
}
|
||||
};
|
||||
|
||||
BDFDB.openContextMenu = function (plugin, e, children) {
|
||||
LibraryModules.ContextMenuUtils.openContextMenu(e, function (e) {
|
||||
return BDFDB.React.createElement(LibraryComponents.ContextMenu, Object.assign({}, e, {
|
||||
BDFDBcontextMenu: true,
|
||||
type: DiscordConstants.ContextMenuTypes.NATIVE_TEXT,
|
||||
value: "",
|
||||
className: `${BDFDB.disCN.contextmenu} BDFDB-contextMenu ${plugin.name}-contextMenuItem`,
|
||||
children
|
||||
}));
|
||||
});
|
||||
};
|
||||
|
||||
BDFDB.appendContextMenu = function (menu, e = Object.assign({currentTarget: document.querySelector(BDFDB.dotCN.app)}, BDFDB.mousePosition)) {
|
||||
if (!Node.prototype.isPrototypeOf(menu)) return;
|
||||
|
|
Loading…
Reference in New Issue