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
This commit is contained in:
Jarek Radosz
2023-08-31 11:49:35 +02:00
committed by GitHub
parent e1ae32103d
commit 1c87bb7fe9
237 changed files with 998 additions and 1091 deletions

View File

@ -3,7 +3,6 @@
@class="discourse-local-dates-create-modal"
@style="overflow: auto"
>
<div class="form">
{{#if this.isValid}}
{{#if this.timezoneIsDifferentFromUserTimezone}}
@ -29,10 +28,10 @@
>
{{d-icon "calendar-alt"}}
<DButton
@id="from-date-time"
@action={{action "focusFrom"}}
@action={{this.focusFrom}}
@translatedLabel={{this.formattedFrom}}
@class="date-time"
id="from-date-time"
class="date-time"
/>
</div>
@ -43,15 +42,15 @@
>
{{d-icon "calendar-alt"}}
<DButton
@action={{action "focusTo"}}
@action={{this.focusTo}}
@translatedLabel={{this.formattedTo}}
@class="date-time"
class="date-time"
/>
{{#if this.toFilled}}
<DButton
@action={{this.eraseToDateTime}}
@icon="times"
@action={{action "eraseToDateTime"}}
@class="delete-to-date"
class="delete-to-date"
/>
{{/if}}
</div>
@ -174,22 +173,22 @@
<div class="modal-footer discourse-local-dates-create-modal-footer">
{{#if this.isValid}}
<DButton
@class="btn-primary"
@action={{action "save"}}
@action={{this.save}}
@label="discourse_local_dates.create.form.insert"
class="btn-primary"
/>
{{/if}}
<DButton
@class="btn-flat"
@action={{action "cancel"}}
@action={{this.cancel}}
@translatedLabel={{i18n "cancel"}}
class="btn-flat"
/>
<DButton
@class="btn-default advanced-mode-btn"
@action={{action "toggleAdvancedMode"}}
@action={{this.toggleAdvancedMode}}
@icon="cog"
@label={{this.toggleModeBtnLabel}}
class="btn-default advanced-mode-btn"
/>
</div>