Simplified the handlebars templates for itemTransfer

This commit is contained in:
WBHarry 2025-11-23 02:58:25 +01:00
parent d2768a2268
commit 5d0a59bd12
3 changed files with 8 additions and 11 deletions

View file

@ -24,19 +24,16 @@ export default class ItemTransferDialog extends HandlebarsApplicationMixin(Appli
};
static PARTS = {
main: { template: 'systems/daggerheart/templates/dialogs/item-transfer/main.hbs' },
footer: { template: 'systems/daggerheart/templates/dialogs/item-transfer/footer.hbs' }
main: { template: 'systems/daggerheart/templates/dialogs/item-transfer.hbs' }
};
_attachPartListeners(partId, htmlElement, options) {
super._attachPartListeners(partId, htmlElement, options);
if (partId === 'main') {
htmlElement.querySelector('.number-display').addEventListener('change', event => {
this.quantity = isNaN(event.target.value) ? this.quantity : Number(event.target.value);
this.render();
});
}
htmlElement.querySelector('.number-display').addEventListener('change', event => {
this.quantity = isNaN(event.target.value) ? this.quantity : Number(event.target.value);
this.render();
});
}
async _prepareContext(_options) {

View file

@ -3,4 +3,7 @@
<input type="range" step="1" min="0" max="{{item.system.quantity}}" name="quantity" value="{{quantity}}" />
<input type="text" value="{{quantity}}" class="number-display" />
</div>
<footer class="item-sheet-footer">
<button type="button" data-action="finish">{{localize "DAGGERHEART.APPLICATIONS.ItemTransfer.transfer"}}</button>
</footer>
</div>

View file

@ -1,3 +0,0 @@
<footer class="item-sheet-footer">
<button type="button" data-action="finish">{{localize "DAGGERHEART.APPLICATIONS.ItemTransfer.transfer"}}</button>
</footer>