Tweak what element is required to be used in order to drag an attribute
This commit is contained in:
parent
47e5d5168b
commit
7d3e6d3653
2 changed files with 4 additions and 2 deletions
|
|
@ -71,7 +71,7 @@ export class AttributeManager extends HandlebarsApplicationMixin(ApplicationV2)
|
|||
};
|
||||
|
||||
new DragDrop.implementation({
|
||||
dragSelector: `[data-attribute]`,
|
||||
dragSelector: `.draggable`,
|
||||
permissions: {
|
||||
dragstart: this._canDragStart.bind(this),
|
||||
drop: this._canDragDrop.bind(this),
|
||||
|
|
@ -194,7 +194,7 @@ export class AttributeManager extends HandlebarsApplicationMixin(ApplicationV2)
|
|||
};
|
||||
|
||||
_onDragStart(event) {
|
||||
const target = event.currentTarget;
|
||||
const target = event.currentTarget.closest(`[data-attribute]`);
|
||||
if (`link` in event.target.dataset) { return };
|
||||
let dragData;
|
||||
|
||||
|
|
@ -208,6 +208,7 @@ export class AttributeManager extends HandlebarsApplicationMixin(ApplicationV2)
|
|||
};
|
||||
|
||||
if (!dragData) { return };
|
||||
event.dataTransfer.setDragImage(target, 16, 23);
|
||||
event.dataTransfer.setData(`text/plain`, JSON.stringify(dragData));
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue