Jarek Radosz 1c87bb7fe9
DEV: Update DButton uses (#23333)
1. Use `this.` instead of `{{action}}` where applicable
2. Use `{{fn}}` instead of `@actionParam` where applicable
3. Use non-`@` versions of class/type/tabindex/aria-controls/aria-expanded
4. Remove `btn` class (it's added automatically to all DButtons)
5. Remove `type="button"` (it's the default)
6. Use `concat-class` helper
2023-08-31 11:49:35 +02:00

52 lines
1.3 KiB
Handlebars

{{#if this.collection}}
<div class="values">
{{#each this.collection as |value index|}}
<div data-index={{index}} class="value">
<DButton
@action={{fn this.removeValue value}}
@icon="times"
class="remove-value-btn btn-small"
/>
<Input
title={{value}}
@value={{value}}
class="value-input"
{{on "focusout" (fn (action "changeValue") index)}}
/>
{{#if this.showUpDownButtons}}
<DButton
@action={{fn this.shift -1 index}}
@icon="arrow-up"
class="shift-up-value-btn btn-small"
/>
<DButton
@action={{fn this.shift 1 index}}
@icon="arrow-down"
class="shift-down-value-btn btn-small"
/>
{{/if}}
</div>
{{/each}}
</div>
{{/if}}
<div class="simple-list-input">
<Input
@type="text"
@value={{this.newValue}}
placeholder={{i18n "admin.site_settings.simple_list.add_item"}}
class="add-value-input"
autocomplete="off"
autocorrect="off"
autocapitalize="off"
/>
<DButton
@action={{fn this.addValue this.newValue}}
@disabled={{this.inputEmpty}}
@icon="plus"
class="add-value-btn btn-small"
/>
</div>