mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 07:59:03 +01:00
Added use of ItemLinkFields
This commit is contained in:
parent
8cdad5172e
commit
569e567dfd
18 changed files with 232 additions and 288 deletions
|
|
@ -341,7 +341,20 @@ export default function DHApplicationMixin(Base) {
|
|||
{
|
||||
name: 'CONTROLS.CommonEdit',
|
||||
icon: 'fa-solid fa-pen-to-square',
|
||||
callback: target => getDocFromElement(target).sheet.render({ force: true })
|
||||
callback: async target => {
|
||||
const doc = getDocFromElement(target);
|
||||
const appId = this.element.id;
|
||||
doc.apps[appId] = this;
|
||||
const app = await doc.sheet.render({ force: true });
|
||||
app.addEventListener(
|
||||
'close',
|
||||
() => {
|
||||
delete doc.apps[appId];
|
||||
},
|
||||
{ once: true }
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
|
|
@ -496,9 +509,21 @@ export default function DHApplicationMixin(Base) {
|
|||
* Renders an embedded document.
|
||||
* @type {ApplicationClickAction}
|
||||
*/
|
||||
static #editDoc(_event, target) {
|
||||
static async #editDoc(_event, target) {
|
||||
const doc = getDocFromElement(target);
|
||||
if (doc) return doc.sheet.render({ force: true });
|
||||
if (doc) {
|
||||
const appId = this.element.id;
|
||||
doc.apps[appId] = this;
|
||||
const app = await doc.sheet.render({ force: true });
|
||||
app.addEventListener(
|
||||
'close',
|
||||
() => {
|
||||
delete doc.apps[appId];
|
||||
},
|
||||
{ once: true }
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: REDO this
|
||||
const { actionId } = target.closest('[data-action-id]').dataset;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue