Initial support for Update button

This commit is contained in:
Ivan Danyliuk 2018-09-06 17:43:56 +03:00
parent 4772b0f10e
commit 664de3bf39
No known key found for this signature in database
GPG Key ID: 97ED33CE024E1DBF

View File

@ -1,9 +1,12 @@
package widgets
import (
"fmt"
"github.com/divan/graphx/layout"
"github.com/gopherjs/vecty"
"github.com/gopherjs/vecty/elem"
"github.com/gopherjs/vecty/event"
)
type ForceEditor struct {
@ -25,6 +28,18 @@ func (l *ForceEditor) Render() vecty.ComponentOrHTML {
),
vecty.List(l.inputs),
),
elem.Div(
elem.Button(
vecty.Markup(
vecty.Class("pure-button"),
vecty.Style("background", "rgb(28, 184, 65)"),
vecty.Style("color", "white"),
vecty.Style("border-radius", "4px"),
event.Click(l.onUpdateClick),
),
vecty.Text("Update"),
),
),
)
}
@ -44,3 +59,7 @@ func NewForceEditor() *ForceEditor {
func (l *ForceEditor) Config() layout.Config {
return l.config
}
func (l *ForceEditor) onUpdateClick(e *vecty.Event) {
fmt.Println("Clicked")
}