mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 02:11:08 -06:00
DEV: add toast progress bar to styleguide (#26767)
This commit is contained in:
parent
5dad583442
commit
dad6912566
@ -61,6 +61,12 @@
|
||||
{{on "click" this.toggleAutoClose}}
|
||||
/>
|
||||
</Styleguide::Controls::Row>
|
||||
<Styleguide::Controls::Row @name="[@options.showProgressBar]">
|
||||
<DToggleSwitch
|
||||
@state={{this.showProgressBar}}
|
||||
{{on "click" this.toggleShowProgressBar}}
|
||||
/>
|
||||
</Styleguide::Controls::Row>
|
||||
{{#if this.autoClose}}
|
||||
<Styleguide::Controls::Row @name="[@options.duration] ms">
|
||||
<Input @value={{this.duration}} @type="number" />
|
||||
|
@ -12,6 +12,7 @@ export default class Toasts extends Component {
|
||||
@tracked message = "Message";
|
||||
@tracked duration = TOAST.options.duration;
|
||||
@tracked autoClose = TOAST.options.autoClose;
|
||||
@tracked showProgressBar = TOAST.options.showProgressBar;
|
||||
@tracked class;
|
||||
@tracked action = true;
|
||||
@tracked icon;
|
||||
@ -48,6 +49,7 @@ export default class Toasts extends Component {
|
||||
this.toasts[theme]({
|
||||
duration: this.duration,
|
||||
autoClose: this.autoClose,
|
||||
showProgressBar: this.showProgressBar,
|
||||
class: this.class,
|
||||
data: {
|
||||
title: this.title,
|
||||
@ -67,4 +69,9 @@ export default class Toasts extends Component {
|
||||
toggleAutoClose() {
|
||||
this.autoClose = !this.autoClose;
|
||||
}
|
||||
|
||||
@action
|
||||
toggleShowProgressBar() {
|
||||
this.showProgressBar = !this.showProgressBar;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user