David Vogel
114a7d893c
- Add input field and general data binding - Rename SymbolSlot to IconSlot - Remove d3c-color-accent - Update icons page - Add input example page - Update button to support highlighting - Update navigation entry to support highlighting - Add d3c-button-only-icon to button and let sidebar use that - Use d3c-button-transparent in sidebar - Add focus indicator to buttons - Rename CSS color variables and change definition of some - Let pagination use input:Button - Add some padding to the inline code component
45 lines
1.2 KiB
Go
45 lines
1.2 KiB
Go
package overlay
|
|
|
|
import (
|
|
"git.d3nexus.de/Dadido3/D3vugu-components/components/input"
|
|
"github.com/vugu/vugu"
|
|
)
|
|
|
|
type ModalRequester struct {
|
|
OverlayContainerRef
|
|
|
|
IconSlot vugu.Builder `vugu:"data"` // Slot for the symbol.
|
|
|
|
Title string `vugu:"data"`
|
|
Message string `vugu:"data"`
|
|
|
|
SignalColor string // A d3c CSS class for the color scheme of the small bar.
|
|
|
|
ClickAbort input.ClickHandler
|
|
ClickYes input.ClickHandler
|
|
}
|
|
|
|
func (c *ModalRequester) handleClickAbort(event vugu.DOMEvent) {
|
|
if c.ClickAbort != nil {
|
|
c.ClickAbort.ClickHandle(input.ClickEvent{DOMEvent: event})
|
|
}
|
|
c.SetModal(nil)
|
|
}
|
|
|
|
func (c *ModalRequester) handleClickYes(event vugu.DOMEvent) {
|
|
if c.ClickYes != nil {
|
|
c.ClickYes.ClickHandle(input.ClickEvent{DOMEvent: event})
|
|
}
|
|
c.SetModal(nil)
|
|
}
|
|
|
|
// OverlayClasses implements OverlayClassesGetter which is used by the overlay package to add classes to overlay elements.
|
|
func (c *ModalRequester) OverlayClasses() (signalClasses, containerClasses string) {
|
|
return c.SignalColor, ""
|
|
}
|
|
|
|
// PageTitle implements PageTitleGetter which is used by PageInfo.
|
|
func (c *ModalRequester) PageTitle() (title, longTitle, shortTitle string) {
|
|
return c.Title, c.Title, c.Title
|
|
}
|