From dd0c5773241795d5a04991b1138f9e97e3e08c36 Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Sun, 25 Jul 2021 02:40:28 +0200 Subject: [PATCH] Fix drag & drop of items --- src/module/actor/sheets/actor-sheet.ts | 60 +++++++++++-------- .../actor/components/control-button-group.hbs | 2 +- .../actor/components/effect-list-entry.hbs | 2 +- .../actor/components/item-list-entry.hbs | 2 +- 4 files changed, 39 insertions(+), 27 deletions(-) diff --git a/src/module/actor/sheets/actor-sheet.ts b/src/module/actor/sheets/actor-sheet.ts index 72d75a81..99e8829f 100644 --- a/src/module/actor/sheets/actor-sheet.ts +++ b/src/module/actor/sheets/actor-sheet.ts @@ -147,7 +147,9 @@ export class DS4ActorSheet extends ActorSheet this.render(false)); } @@ -172,7 +174,7 @@ export class DS4ActorSheet extends ActorSheet this.render(false)); } @@ -239,7 +243,7 @@ export class DS4ActorSheet extends ActorSheet notifications.error(e, { log: true })); @@ -379,3 +377,17 @@ interface EnrichedActiveEffectDataSource extends ActiveEffectDataSource { icon: string; sourceName: string; } + +/** + * This object contains information about specific properties embedded document list entries for each different type. + */ +const embeddedDocumentListEntryProperties = Object.freeze({ + ActiveEffect: { + selector: ".effect", + idDataAttribute: "effectId", + }, + Item: { + selector: ".item", + idDataAttribute: "itemId", + }, +}); diff --git a/src/templates/sheets/actor/components/control-button-group.hbs b/src/templates/sheets/actor/components/control-button-group.hbs index 89713898..dffef3e0 100644 --- a/src/templates/sheets/actor/components/control-button-group.hbs +++ b/src/templates/sheets/actor/components/control-button-group.hbs @@ -7,7 +7,7 @@ SPDX-License-Identifier: MIT {{!-- !-- Render a group of an "edit" and a "delete" button. -!-- The current item is defined by the data-id attribute of the parent li element. +!-- The current item is defined by the a corresponding id attribute of the parent li element. !-- @param documentType: The type of document that is controlled by this button group, item or effect !-- @param editTitle: The title to use for the edit link element (will be localized) !-- @param deleteTitle: The title to use for the delete link element (will be localized) diff --git a/src/templates/sheets/actor/components/effect-list-entry.hbs b/src/templates/sheets/actor/components/effect-list-entry.hbs index 4fbb0a95..f9c9d908 100644 --- a/src/templates/sheets/actor/components/effect-list-entry.hbs +++ b/src/templates/sheets/actor/components/effect-list-entry.hbs @@ -9,7 +9,7 @@ SPDX-License-Identifier: MIT !-- Render an effect list entry row. !-- @param effectData: The data of the item. --}} -
  • +
  • {{!-- enabled --}} +
  • {{!-- equipped --}} {{#if isEquipable}}