Support drag-drop vers conteneur
This commit is contained in:
@ -26,7 +26,6 @@ export class RdDActorSheet extends ActorSheet {
|
||||
classes: ["rdd", "sheet", "actor"],
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-sheet.html",
|
||||
width: 640,
|
||||
//height: 720,
|
||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }],
|
||||
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
|
||||
editCaracComp: false,
|
||||
@ -132,13 +131,15 @@ export class RdDActorSheet extends ActorSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _onDropActor(event, dragData) {
|
||||
console.log("DRAG", this.actor.id, dragData);
|
||||
console.log("_onDropActor", this.actor.id, dragData);
|
||||
this.actor.addSubacteur(dragData.id || dragData.data._id);
|
||||
super._onDropActor(event, dragData);
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async _onDropItem(event, dragData) {
|
||||
const callSuper = await this.actor.processDropItem(RdDSheetUtility.extractItemDropParameters(event, dragData, this.actor, this.objetVersConteneur));
|
||||
const destItemId = RdDSheetUtility.getItemId(event);
|
||||
const dropParams = RdDSheetUtility.prepareItemDropParameters(destItemId, this.actor.id, dragData, this.objetVersConteneur);
|
||||
const callSuper = await this.actor.processDropItem(dropParams);
|
||||
if (callSuper) {
|
||||
await super._onDropItem(event, dragData)
|
||||
}
|
||||
|
Reference in New Issue
Block a user