[PR] Changing the drag targets in the inventory item v2 template (#1443)

* Adding styles to make the text div take up the full area of the inventory items

* Moving the draggable spots to internal divs and images

* For better visuals in dragDrop, always make the drag image the first image selected

* Fixing the dragDrop behavior on the sidebar, which still uses the classic layout

* Fixing other uses of dragDrop to handle the layout change

* Moving the draggable attribute to the parent img-portrait from img directly

* Switching to the less pretty version of the drag drop in case of currency problems

* Reverting how the dragSelector DEFAULT_OPTION is set and only modifying a few

* Removing extra space in styles/less/global/inventory-item.less

Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>

* Fixing up the character sheet to once again allow selecting the text areas

---------

Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>
This commit is contained in:
Nick Salyzyn 2025-12-23 06:14:55 -07:00 committed by GitHub
parent 51eadc499f
commit a168d8de65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 18 additions and 8 deletions

View file

@ -26,7 +26,7 @@ export default class AdversarySheet extends DHBaseActorSheet {
}
]
},
dragDrop: [{ dragSelector: '[data-item-id][draggable="true"]', dropSelector: null }]
dragDrop: [{ dragSelector: '[data-item-id]', dropSelector: null }]
};
static PARTS = {

View file

@ -46,7 +46,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
},
dragDrop: [
{
dragSelector: '[data-item-id][draggable="true"]',
dragSelector: '[data-item-id][draggable="true"], [data-item-id] [draggable="true"]',
dropSelector: null
}
],
@ -868,6 +868,15 @@ export default class CharacterSheet extends DHBaseActorSheet {
});
}
/** @inheritdoc */
async _onDragStart(event) {
const inventoryItem = event.currentTarget.closest('.inventory-item');
if (inventoryItem) {
event.dataTransfer.setDragImage(inventoryItem.querySelector('img'), 60, 0);
}
super._onDragStart(event);
}
async _onDropItem(event, item) {
if (this.document.uuid === item.parent?.uuid) {
return super._onDropItem(event, item);

View file

@ -40,7 +40,7 @@ export default class Party extends DHBaseActorSheet {
selectRefreshable: DaggerheartMenu.selectRefreshable,
refreshActors: DaggerheartMenu.refreshActors
},
dragDrop: [{ dragSelector: '[data-item-id][draggable="true"]', dropSelector: null }]
dragDrop: [{ dragSelector: '[data-item-id]', dropSelector: null }]
};
/**@override */