| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- //go:build js && wasm
- package ultraviolet
- import (
- "syscall/js"
- )
- type FrameComponentWeb struct {
- node js.Value
- view View
- change bool
- url string
- }
- func NewFrameComponentWeb(view View) *FrameComponentWeb {
- return &FrameComponentWeb{
- view: view,
- change: true,
- url: "",
- }
- }
- // Component
- func (this *FrameComponentWeb) Build(parent Component) {
- this.node = WebBuildFrame(
- this.node,
- parent,
- this.view,
- this.url,
- )
- }
- func (this *FrameComponentWeb) Invalidate() bool {
- result := this.change
- this.change = false
- return result
- }
- func (this *FrameComponentWeb) Clean() {
- WebCleanChildren(this.node)
- }
- // JS
- func (this *FrameComponentWeb) Node() js.Value {
- return this.node
- }
- // ComponentFrame
- func (this *FrameComponentWeb) SetUrl(url string) {
- this.url = url
- }
|