mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-16 05:31:07 +01:00
[Feature] Scene Environments (#1499)
* Initial * Remade to array structure * Fixed context menu for multiples * . * Cleanup * . * Fixed so that users can access sceneEnvironments if they have permissions * Update module/documents/scene.mjs Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com> * . --------- Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>
This commit is contained in:
parent
454507ba7b
commit
8de12551ad
15 changed files with 395 additions and 23 deletions
|
|
@ -96,11 +96,11 @@ export default class DHContextMenu extends foundry.applications.ux.ContextMenu {
|
|||
* Trigger a context menu event in response to a normal click on a additional options button.
|
||||
* @param {PointerEvent} event
|
||||
*/
|
||||
static triggerContextMenu(event) {
|
||||
static triggerContextMenu(event, altSelector) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
const { clientX, clientY } = event;
|
||||
const selector = '[data-item-uuid]';
|
||||
const selector = altSelector ?? '[data-item-uuid]';
|
||||
const target = event.target.closest(selector) ?? event.currentTarget.closest(selector);
|
||||
target?.dispatchEvent(
|
||||
new PointerEvent('contextmenu', {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue