David Vogel
69160e02c4
- Rename overlay-classes.go to interfaces.go - Add event parameter to AddToast method - Update overlay example page
25 lines
521 B
Go
25 lines
521 B
Go
package overlay
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/vugu/vugu"
|
|
)
|
|
|
|
type ToastSimple struct {
|
|
IconSlot vugu.Builder `vugu:"data"` // Slot for the symbol.
|
|
|
|
Message string `vugu:"data"`
|
|
Duration time.Duration // Auto close toast after this duration.
|
|
|
|
SignalColor string // A d3c CSS class for the color scheme of the small bar.
|
|
}
|
|
|
|
func (c *ToastSimple) OverlayClasses() (signalClasses, containerClasses string) {
|
|
return c.SignalColor, ""
|
|
}
|
|
|
|
func (c *ToastSimple) ToastDuration() time.Duration {
|
|
return c.Duration
|
|
}
|