diff --git a/module/applications/sheets/api/application-mixin.mjs b/module/applications/sheets/api/application-mixin.mjs index 98f38f03..0168f46d 100644 --- a/module/applications/sheets/api/application-mixin.mjs +++ b/module/applications/sheets/api/application-mixin.mjs @@ -603,7 +603,7 @@ export default function DHApplicationMixin(Base) { const doc = await fromUuid(itemUuid); //get inventory-item description element - const descriptionElement = el.querySelector('.invetory-description'); + const descriptionElement = el.querySelector('.inventory-description'); if (!doc || !descriptionElement) continue; // localize the description (idk if it's still necessary) diff --git a/module/data/action/baseAction.mjs b/module/data/action/baseAction.mjs index 27383b7a..f3008704 100644 --- a/module/data/action/baseAction.mjs +++ b/module/data/action/baseAction.mjs @@ -54,6 +54,10 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel return {}; } + get hasDescription() { + return Boolean(this.description); + } + /** * Create a Map containing each Action step based on fields define in schema. Ordered by Fields order property. * diff --git a/module/documents/activeEffect.mjs b/module/documents/activeEffect.mjs index cdfc9a52..4a9f3cc4 100644 --- a/module/documents/activeEffect.mjs +++ b/module/documents/activeEffect.mjs @@ -65,6 +65,10 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect { ); } + get hasDescription() { + return Boolean(this.description); + } + /* -------------------------------------------- */ /* Event Handlers */ /* -------------------------------------------- */ diff --git a/module/documents/item.mjs b/module/documents/item.mjs index 32543ebd..ee36131c 100644 --- a/module/documents/item.mjs +++ b/module/documents/item.mjs @@ -89,6 +89,10 @@ export default class DHItem extends foundry.documents.Item { return !pack?.locked && this.isOwner && isValidType && hasActions; } + get hasDescription() { + return Boolean(this.system.description); + } + /** @inheritdoc */ static async createDialog(data = {}, createOptions = {}, options = {}) { const { folders, types, template, context = {}, ...dialogOptions } = options; diff --git a/styles/less/global/inventory-item.less b/styles/less/global/inventory-item.less index a89da161..fc73ba95 100644 --- a/styles/less/global/inventory-item.less +++ b/styles/less/global/inventory-item.less @@ -54,10 +54,8 @@ margin-left: 10px; display: inline-block; } - &:has(.inventory-item-content.extensible) { - .item-main { - background: light-dark(@dark-blue-40, @golden-40); - } + .item-main { + background: light-dark(@dark-blue-40, @golden-40); } &:has(.inventory-item-content.extended) { .inventory-item-header .item-label .item-name .expanded-icon { @@ -163,7 +161,7 @@ grid-template-rows: 1fr; padding-top: 4px; } - .invetory-description { + .inventory-description { overflow: hidden; h1 { diff --git a/templates/sheets/global/partials/inventory-item-V2.hbs b/templates/sheets/global/partials/inventory-item-V2.hbs index ac9eea78..775690d4 100644 --- a/templates/sheets/global/partials/inventory-item-V2.hbs +++ b/templates/sheets/global/partials/inventory-item-V2.hbs @@ -26,7 +26,7 @@ Parameters: data-item-uuid="{{item.uuid}}" data-no-compendium-edit="{{noCompendiumEdit}}" >
-
+
{{!-- Image --}}
{{!-- Item Name --}} - {{localize item.name}} {{#unless (or noExtensible (not item.system.description))}}{{/unless}} + {{localize item.name}} {{#unless (or noExtensible (not item.hasDescription))}}{{/unless}} {{!-- Tags Start --}} {{#if (not hideTags)}} @@ -130,12 +130,12 @@ Parameters:
{{/unless}}
-
- {{!-- Description --}} - {{#unless hideDescription}} -
- {{/unless}} -
+ {{#unless hideDescription}} +
+ {{!-- Description --}} +
+
+ {{/unless}}
{{!-- Dice Resource --}} {{#if (and (not hideResources) (eq item.system.resource.type 'diceValue'))}}