mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +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:
@ -3,8 +3,8 @@
|
||||
<DButton
|
||||
@icon="times"
|
||||
@translatedTitle={{bs.text}}
|
||||
@class={{bs.class}}
|
||||
@disabled={{bs.disabled}}
|
||||
class={{bs.class}}
|
||||
/>
|
||||
{{/each}}
|
||||
</StyleguideExample>
|
||||
@ -14,8 +14,8 @@
|
||||
<DButton
|
||||
@icon="times"
|
||||
@translatedTitle={{bs.text}}
|
||||
@class={{bs.class}}
|
||||
@disabled={{bs.disabled}}
|
||||
class={{bs.class}}
|
||||
/>
|
||||
{{/each}}
|
||||
</StyleguideExample>
|
||||
@ -24,8 +24,8 @@
|
||||
{{#each @dummy.buttonSizes as |bs|}}
|
||||
<DButton
|
||||
@translatedLabel={{bs.text}}
|
||||
@class={{bs.class}}
|
||||
@disabled={{bs.disabled}}
|
||||
class={{bs.class}}
|
||||
/>
|
||||
{{/each}}
|
||||
</StyleguideExample>
|
||||
@ -34,8 +34,8 @@
|
||||
{{#each @dummy.buttonStates as |bs|}}
|
||||
<DButton
|
||||
@translatedLabel={{bs.text}}
|
||||
@class={{bs.class}}
|
||||
@disabled={{bs.disabled}}
|
||||
class={{bs.class}}
|
||||
/>
|
||||
{{/each}}
|
||||
</StyleguideExample>
|
||||
@ -47,8 +47,8 @@
|
||||
<DButton
|
||||
@icon="plus"
|
||||
@translatedLabel={{bs.text}}
|
||||
@class={{bs.class}}
|
||||
@disabled={{bs.disabled}}
|
||||
class={{bs.class}}
|
||||
/>
|
||||
{{/each}}
|
||||
</StyleguideExample>
|
||||
@ -58,8 +58,8 @@
|
||||
<DButton
|
||||
@icon="plus"
|
||||
@translatedLabel={{bs.text}}
|
||||
@class={{bs.class}}
|
||||
@disabled={{bs.disabled}}
|
||||
class={{bs.class}}
|
||||
/>
|
||||
{{/each}}
|
||||
</StyleguideExample>
|
||||
@ -69,10 +69,10 @@
|
||||
>
|
||||
{{#each @dummy.buttonSizes as |bs|}}
|
||||
<DButton
|
||||
@class={{concat "btn-primary " bs.class}}
|
||||
@icon="plus"
|
||||
@translatedLabel={{bs.text}}
|
||||
@disabled={{bs.disabled}}
|
||||
class={{concat-class "btn-primary" bs.class}}
|
||||
/>
|
||||
{{/each}}
|
||||
</StyleguideExample>
|
||||
@ -80,10 +80,10 @@
|
||||
<StyleguideExample @title=".btn-primary .btn-icon-text - states">
|
||||
{{#each @dummy.buttonStates as |bs|}}
|
||||
<DButton
|
||||
@class={{concat "btn-primary " bs.class}}
|
||||
@icon="plus"
|
||||
@translatedLabel={{bs.text}}
|
||||
@disabled={{bs.disabled}}
|
||||
class={{concat-class "btn-primary" bs.class}}
|
||||
/>
|
||||
{{/each}}
|
||||
</StyleguideExample>
|
||||
@ -93,10 +93,10 @@
|
||||
>
|
||||
{{#each @dummy.buttonSizes as |bs|}}
|
||||
<DButton
|
||||
@class={{concat "btn-danger " bs.class}}
|
||||
@icon="trash-alt"
|
||||
@translatedLabel={{bs.text}}
|
||||
@disabled={{bs.disabled}}
|
||||
class={{concat-class "btn-danger" bs.class}}
|
||||
/>
|
||||
{{/each}}
|
||||
</StyleguideExample>
|
||||
@ -104,10 +104,10 @@
|
||||
<StyleguideExample @title=".btn-danger .btn-icon-text - states">
|
||||
{{#each @dummy.buttonStates as |bs|}}
|
||||
<DButton
|
||||
@class={{concat "btn-danger " bs.class}}
|
||||
@icon="trash-alt"
|
||||
@translatedLabel={{bs.text}}
|
||||
@disabled={{bs.disabled}}
|
||||
class={{concat-class "btn-danger" bs.class}}
|
||||
/>
|
||||
{{/each}}
|
||||
</StyleguideExample>
|
||||
@ -137,9 +137,9 @@
|
||||
>
|
||||
{{#each @dummy.buttonSizes as |bs|}}
|
||||
<DButton
|
||||
@class={{concat "btn-flat " bs.class}}
|
||||
@disabled={{bs.disabled}}
|
||||
@translatedLabel={{bs.text}}
|
||||
class={{concat-class "btn-flat" bs.class}}
|
||||
/>
|
||||
{{/each}}
|
||||
</StyleguideExample>
|
||||
@ -147,9 +147,9 @@
|
||||
<StyleguideExample @title="<DButton> btn-flat btn-text - states">
|
||||
{{#each @dummy.buttonStates as |bs|}}
|
||||
<DButton
|
||||
@class={{concat "btn-flat " bs.class}}
|
||||
@disabled={{bs.disabled}}
|
||||
@translatedLabel={{bs.text}}
|
||||
class={{concat-class "btn-flat" bs.class}}
|
||||
/>
|
||||
{{/each}}
|
||||
</StyleguideExample>
|
||||
|
@ -14,10 +14,10 @@
|
||||
<div class="inline-form">
|
||||
<TextField @placeholder="Placeholder" />
|
||||
<DButton
|
||||
@class="btn-primary"
|
||||
@icon="search"
|
||||
@type="submit"
|
||||
@translatedLabel="Submit"
|
||||
type="submit"
|
||||
class="btn-primary"
|
||||
/>
|
||||
</div>
|
||||
</StyleguideExample>
|
||||
@ -25,7 +25,7 @@
|
||||
<StyleguideExample @title="inline-form with icon button">
|
||||
<div class="inline-form">
|
||||
<TextField @placeholder="Placeholder" />
|
||||
<DButton @class="btn-primary" @icon="search" @type="submit" />
|
||||
<DButton @icon="search" type="submit" class="btn-primary" />
|
||||
</div>
|
||||
</StyleguideExample>
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
<StyleguideExample @title="full-width inline-form with input and icon button">
|
||||
<div class="inline-form full-width">
|
||||
<TextField @placeholder="Placeholder" />
|
||||
<DButton @class="btn-primary" @icon="search" @type="submit" />
|
||||
<DButton @icon="search" type="submit" class="btn-primary" />
|
||||
</div>
|
||||
</StyleguideExample>
|
||||
|
||||
@ -55,10 +55,10 @@
|
||||
@onChange={{fn (mut value)}}
|
||||
/>
|
||||
<DButton
|
||||
@class="btn-primary"
|
||||
@icon="search"
|
||||
@type="submit"
|
||||
@translatedLabel="Submit"
|
||||
type="submit"
|
||||
class="btn-primary"
|
||||
/>
|
||||
</div>
|
||||
</StyleguideExample>
|
||||
@ -68,10 +68,10 @@
|
||||
<TextField />
|
||||
<MultiSelect @content={{@dummy.options}} @onChange={{@dummyAction}} />
|
||||
<DButton
|
||||
@class="btn-primary"
|
||||
@icon="search"
|
||||
@type="submit"
|
||||
@translatedLabel="Submit"
|
||||
type="submit"
|
||||
class="btn-primary"
|
||||
/>
|
||||
</div>
|
||||
</StyleguideExample>
|
||||
@ -82,10 +82,10 @@
|
||||
<TextField />
|
||||
<MultiSelect @content={{@dummy.options}} @onChange={{@dummyAction}} />
|
||||
<DButton
|
||||
@class="btn-primary"
|
||||
@icon="search"
|
||||
@type="submit"
|
||||
@translatedLabel="Submit"
|
||||
type="submit"
|
||||
class="btn-primary"
|
||||
/>
|
||||
</div>
|
||||
</StyleguideExample>
|
||||
|
@ -6,8 +6,8 @@
|
||||
<div id="topic-footer-buttons">
|
||||
<DButton
|
||||
@icon="reply"
|
||||
@class="btn-primary pull-right"
|
||||
@label="topic.reply.title"
|
||||
class="btn-primary pull-right"
|
||||
/>
|
||||
</div>
|
||||
</StyleguideExample>
|
@ -223,7 +223,7 @@
|
||||
<DButton
|
||||
@icon="envelope"
|
||||
@label="admin.users.check_email.text"
|
||||
@class="btn-primary"
|
||||
class="btn-primary"
|
||||
/>
|
||||
</dd>
|
||||
<dt class="groups">
|
||||
@ -239,7 +239,7 @@
|
||||
<DButton
|
||||
@icon="exclamation-triangle"
|
||||
@label="user.admin_delete"
|
||||
@class="btn-danger"
|
||||
class="btn-danger"
|
||||
/>
|
||||
</dl>
|
||||
</div>
|
||||
@ -378,7 +378,7 @@
|
||||
<DButton
|
||||
@icon="envelope"
|
||||
@label="admin.users.check_email.text"
|
||||
@class="btn-primary"
|
||||
class="btn-primary"
|
||||
/>
|
||||
</dd>
|
||||
<dt class="groups">
|
||||
@ -394,7 +394,7 @@
|
||||
<DButton
|
||||
@icon="exclamation-triangle"
|
||||
@label="user.admin_delete"
|
||||
@class="btn-danger"
|
||||
class="btn-danger"
|
||||
/>
|
||||
</dl>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user