use v13s default drop handling for actor sheets
This commit is contained in:
parent
e340a68cff
commit
4bc8645fcb
17
src/main.mjs
17
src/main.mjs
@ -1115,23 +1115,6 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
|
||||
},
|
||||
};
|
||||
|
||||
_onFirstRender(context, options) {
|
||||
super._onFirstRender(context, options);
|
||||
|
||||
const content = this.element.querySelector(".window-content");
|
||||
content.addEventListener("drop", async (event) => {
|
||||
event.preventDefault();
|
||||
const data = TextEditor.getDragEventData(event);
|
||||
|
||||
switch (data.type) {
|
||||
case "Item": {
|
||||
const item = await Item.implementation.fromDropData(data);
|
||||
await this.actor.createEmbeddedDocuments("Item", [item.toObject()]);
|
||||
} break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// allow changing embedded item fields
|
||||
async _onChangeForm(formConfig, event) {
|
||||
const item_id = event.target.closest("[data-item-id]")?.dataset.itemId;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user