mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
Allow viewing domain card item sheet by clicking the name in grid view (#1215)
This commit is contained in:
parent
dc073aa9cc
commit
45b9b52314
2 changed files with 13 additions and 3 deletions
|
|
@ -99,6 +99,7 @@ export default function DHApplicationMixin(Base) {
|
||||||
deleteDoc: DHSheetV2.#deleteDoc,
|
deleteDoc: DHSheetV2.#deleteDoc,
|
||||||
toChat: DHSheetV2.#toChat,
|
toChat: DHSheetV2.#toChat,
|
||||||
useItem: DHSheetV2.#useItem,
|
useItem: DHSheetV2.#useItem,
|
||||||
|
viewItem: DHSheetV2.#viewItem,
|
||||||
toggleEffect: DHSheetV2.#toggleEffect,
|
toggleEffect: DHSheetV2.#toggleEffect,
|
||||||
toggleExtended: DHSheetV2.#toggleExtended,
|
toggleExtended: DHSheetV2.#toggleExtended,
|
||||||
addNewItem: DHSheetV2.#addNewItem,
|
addNewItem: DHSheetV2.#addNewItem,
|
||||||
|
|
@ -710,7 +711,7 @@ export default function DHApplicationMixin(Base) {
|
||||||
* @type {ApplicationClickAction}
|
* @type {ApplicationClickAction}
|
||||||
*/
|
*/
|
||||||
static async #toChat(_event, target) {
|
static async #toChat(_event, target) {
|
||||||
let doc = await getDocFromElement(target);
|
const doc = await getDocFromElement(target);
|
||||||
return doc.toChat(doc.uuid);
|
return doc.toChat(doc.uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -719,10 +720,19 @@ export default function DHApplicationMixin(Base) {
|
||||||
* @type {ApplicationClickAction}
|
* @type {ApplicationClickAction}
|
||||||
*/
|
*/
|
||||||
static async #useItem(event, target) {
|
static async #useItem(event, target) {
|
||||||
let doc = await getDocFromElement(target);
|
const doc = await getDocFromElement(target);
|
||||||
await doc.use(event);
|
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
|
* Toggle a ActiveEffect
|
||||||
* @type {ApplicationClickAction}
|
* @type {ApplicationClickAction}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,6 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span class="card-name">{{item.name}}</span>
|
<span class="card-name" data-action="viewItem">{{item.name}}</span>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue