From 7c0ab25e103d7f762863276d97c32b5581b26944 Mon Sep 17 00:00:00 2001 From: WBHarry Date: Sat, 14 Mar 2026 00:10:48 +0100 Subject: [PATCH] Fixed contextmenu --- module/applications/ux/contextMenu.mjs | 40 -------------------------- 1 file changed, 40 deletions(-) diff --git a/module/applications/ux/contextMenu.mjs b/module/applications/ux/contextMenu.mjs index 6e70da0c..9a308667 100644 --- a/module/applications/ux/contextMenu.mjs +++ b/module/applications/ux/contextMenu.mjs @@ -52,46 +52,6 @@ * @extends {foundry.applications.ux.ContextMenu} */ export default class DHContextMenu extends foundry.applications.ux.ContextMenu { - /** - * @param {HTMLElement|jQuery} container - The HTML element that contains the context menu targets. - * @param {string} selector - A CSS selector which activates the context menu. - * @param {ContextMenuEntry[]} menuItems - An Array of entries to display in the menu - * @param {ContextMenuOptions} [options] - Additional options to configure the context menu. - */ - constructor(container, selector, menuItems, options) { - super(container, selector, menuItems, options); - - /** @deprecated since v13 until v15 */ - this.#jQuery = options.jQuery; - } - - /** - * Whether to pass jQuery objects or HTMLElement instances to callback. - * @type {boolean} - */ - #jQuery; - - /**@inheritdoc */ - activateListeners(menu) { - menu.addEventListener('click', this.#onClickItem.bind(this)); - } - - /** - * Handle click events on context menu items. - * @param {PointerEvent} event The click event - */ - #onClickItem(event) { - event.preventDefault(); - event.stopPropagation(); - const element = event.target.closest('.context-item'); - if (!element) return; - const item = this.menuItems.find(i => i.element === element); - item?.onClick(event, this.#jQuery ? $(this.target) : this.target); - this.close(); - } - - /* -------------------------------------------- */ - /** * Trigger a context menu event in response to a normal click on a additional options button. * @param {PointerEvent} event