Allow viewing domain card item sheet by clicking the name in grid view (#1215)

This commit is contained in:
Carlos Fernandez 2025-10-15 09:01:41 -04:00 committed by GitHub
parent dc073aa9cc
commit 45b9b52314
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 3 deletions

View file

@ -99,6 +99,7 @@ export default function DHApplicationMixin(Base) {
deleteDoc: DHSheetV2.#deleteDoc,
toChat: DHSheetV2.#toChat,
useItem: DHSheetV2.#useItem,
viewItem: DHSheetV2.#viewItem,
toggleEffect: DHSheetV2.#toggleEffect,
toggleExtended: DHSheetV2.#toggleExtended,
addNewItem: DHSheetV2.#addNewItem,
@ -710,7 +711,7 @@ export default function DHApplicationMixin(Base) {
* @type {ApplicationClickAction}
*/
static async #toChat(_event, target) {
let doc = await getDocFromElement(target);
const doc = await getDocFromElement(target);
return doc.toChat(doc.uuid);
}
@ -719,10 +720,19 @@ export default function DHApplicationMixin(Base) {
* @type {ApplicationClickAction}
*/
static async #useItem(event, target) {
let doc = await getDocFromElement(target);
const doc = await getDocFromElement(target);
await doc.use(event);
}
/**
* View an item by opening its sheet
* @type {ApplicationClickAction}
*/
static async #viewItem(_, target) {
const doc = await getDocFromElement(target);
await doc.sheet.render({ force: true });
}
/**
* Toggle a ActiveEffect
* @type {ApplicationClickAction}