Made the wildcard image select dialog scrollable

This commit is contained in:
WBHarry 2025-11-15 13:55:52 +01:00
parent 3959c6261d
commit bea5c08fbd
3 changed files with 13 additions and 6 deletions

View file

@ -12,7 +12,7 @@ export default class ImageSelectDialog extends HandlebarsApplicationMixin(Applic
tag: 'form', tag: 'form',
classes: ['daggerheart', 'dialog', 'dh-style', 'image-select'], classes: ['daggerheart', 'dialog', 'dh-style', 'image-select'],
position: { position: {
width: 600, width: 612,
height: 'auto' height: 'auto'
}, },
window: { window: {
@ -30,7 +30,10 @@ export default class ImageSelectDialog extends HandlebarsApplicationMixin(Applic
/** @override */ /** @override */
static PARTS = { static PARTS = {
main: { template: 'systems/daggerheart/templates/dialogs/image-select/main.hbs' }, main: {
template: 'systems/daggerheart/templates/dialogs/image-select/main.hbs',
scrollable: ['.images-container']
},
footer: { template: 'systems/daggerheart/templates/dialogs/image-select/footer.hbs' } footer: { template: 'systems/daggerheart/templates/dialogs/image-select/footer.hbs' }
}; };

View file

@ -6,6 +6,8 @@
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 8px; gap: 8px;
max-height: 420px;
overflow: auto;
img { img {
width: 136px; width: 136px;

View file

@ -1,5 +1,7 @@
<div class="images-container"> <div>
{{#each images as |image|}} <div class="images-container">
<a data-action="selectImage"><img {{#if (eq image @root.selectedImage)}}class="selected"{{/if}} src="{{image}}" data-image="{{image}}" /></a> {{#each images as |image|}}
{{/each}} <a data-action="selectImage"><img {{#if (eq image @root.selectedImage)}}class="selected"{{/if}} src="{{image}}" data-image="{{image}}" /></a>
{{/each}}
</div>
</div> </div>