Update 0BDFDB.plugin.js

This commit is contained in:
Mirco Wittrien 2024-03-29 10:23:50 +01:00
parent 5addaae42b
commit 2e3efda1f5
1 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,7 @@
* @name BDFDB
* @author DevilBro
* @authorId 278543574059057154
* @version 3.6.2
* @version 3.6.3
* @description Required Library for DevilBro's Plugins
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -1525,7 +1525,7 @@ module.exports = (_ => {
let eventCallback = null;
if (selector) {
if (origEventName == "mouseenter" || origEventName == "mouseleave") eventCallback = e => {
for (let child of e.path) if (typeof child.matches == "function" && child.matches(selector) && !child[namespace + "BDFDB" + origEventName]) {
if (e.composedPath) for (let child of e.composedPath()) if (typeof child.matches == "function" && child.matches(selector) && !child[namespace + "BDFDB" + origEventName]) {
child[namespace + "BDFDB" + origEventName] = true;
if (origEventName == "mouseenter") callback(BDFDB.ListenerUtils.copyEvent(e, child));
let mouseOut = e2 => {
@ -1540,7 +1540,7 @@ module.exports = (_ => {
}
};
else eventCallback = e => {
for (let child of e.path) if (typeof child.matches == "function" && child.matches(selector)) {
if (e.composedPath) for (let child of e.composedPath()) if (typeof child.matches == "function" && child.matches(selector)) {
callback(BDFDB.ListenerUtils.copyEvent(e, child));
break;
}
@ -1641,9 +1641,9 @@ module.exports = (_ => {
if (!e || !e.constructor || !e.type) return e;
let eCopy = new e.constructor(e.type, e);
Object.defineProperty(eCopy, "originalEvent", {value: e});
Object.defineProperty(eCopy, "composedPath", {value: e.composedPath});
Object.defineProperty(eCopy, "which", {value: e.which});
Object.defineProperty(eCopy, "keyCode", {value: e.keyCode});
Object.defineProperty(eCopy, "path", {value: e.path});
Object.defineProperty(eCopy, "relatedTarget", {value: e.relatedTarget});
Object.defineProperty(eCopy, "srcElement", {value: e.srcElement});
Object.defineProperty(eCopy, "target", {value: e.target});