mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
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:
@ -73,7 +73,7 @@
|
||||
{{#if this.canRemoveOption}}
|
||||
<DButton
|
||||
@icon="trash-alt"
|
||||
@action={{action "removeOption" option}}
|
||||
@action={{fn this.removeOption option}}
|
||||
/>
|
||||
{{/if}}
|
||||
</div>
|
||||
@ -81,10 +81,10 @@
|
||||
|
||||
<div class="poll-option-controls">
|
||||
<DButton
|
||||
class="btn-default poll-option-add"
|
||||
@icon="plus"
|
||||
@label="poll.ui_builder.poll_options.add"
|
||||
@action={{fn this.addOption -1}}
|
||||
class="btn-default poll-option-add"
|
||||
/>
|
||||
{{#if
|
||||
(and
|
||||
@ -230,24 +230,24 @@
|
||||
</:body>
|
||||
<:footer>
|
||||
<DButton
|
||||
@action={{action "insertPoll"}}
|
||||
@action={{this.insertPoll}}
|
||||
@icon="chart-bar"
|
||||
class="btn-primary insert-poll"
|
||||
@label="poll.ui_builder.insert"
|
||||
@disabled={{this.disableInsert}}
|
||||
class="btn-primary insert-poll"
|
||||
/>
|
||||
|
||||
<DButton @label="cancel" @class="btn-flat" @action={{@closeModal}} />
|
||||
<DButton @label="cancel" @action={{@closeModal}} class="btn-flat" />
|
||||
|
||||
<DButton
|
||||
@action={{action "toggleAdvanced"}}
|
||||
class="btn-default show-advanced"
|
||||
@action={{this.toggleAdvanced}}
|
||||
@icon="cog"
|
||||
@title={{if
|
||||
this.showAdvanced
|
||||
"poll.ui_builder.hide_advanced"
|
||||
"poll.ui_builder.show_advanced"
|
||||
}}
|
||||
class="btn-default show-advanced"
|
||||
/>
|
||||
|
||||
</:footer>
|
||||
|
Reference in New Issue
Block a user