This commit is contained in:
Mirco Wittrien 2019-12-05 11:28:56 +01:00
parent 1ebf8a9499
commit 649a800e83
2 changed files with 2 additions and 6 deletions

View File

@ -1337,16 +1337,12 @@
// REMOVE
let isOldType = plugin["on" + type].toString().split("\n")[0].replace(/ /g, "").split(",").length > 1;
if (isOldType) BDFDB.ModuleUtils.patch(plugin, module.exports, "default", {after: e => {
let instance = e.thisObject, returnvalue = e.returnValue;
if (e.returnValue && typeof plugin[`on${type}`] === "function") plugin[`on${type}`]({props:e.methodArguments[0]}, document, e.returnValue);
}});
else BDFDB.ModuleUtils.patch(plugin, module.exports, "default", {after: e => {
if (e.returnValue && typeof plugin[`on${type}`] === "function") plugin[`on${type}`]({instance:{props:e.methodArguments[0]}, returnvalue:e.returnValue, methodname:"render"});
if (e.returnValue && typeof plugin[`on${type}`] === "function") plugin[`on${type}`]({instance:{props:e.methodArguments[0]}, returnvalue:e.returnValue, methodname:"default"});
}});
}
BDFDB.ModuleUtils.patch(plugin, module.exports, "default", {after: e => {
if (e.thisObject && e.returnValue && typeof plugin[`on${type}`] === "function") plugin[`on${type}`]({instance:{props:e.methodArguments[0]}, returnvalue:e.returnValue, methodname:"render"});
}});
};
InternalBDFDB.patchPopoutPlugin = (plugin, type, module) => {
if (module && module.prototype) {

File diff suppressed because one or more lines are too long