Example #1
0
File: bool.go Project: kego/ke
func (v *BoolEditorView) Receive(notif flux.NotifPayload) {
	defer close(notif.Done)
	vecty.Rerender(v)
	if notif.Type == stores.NodeFocus {
		v.Focus()
	}
}
Example #2
0
func (v *BranchControlView) Receive(notif flux.NotifPayload) {
	defer close(notif.Done)
	vecty.Rerender(v)
	if v.model != nil && v.App.Branches.Selected() == v.model {
		v.focus()
	}
}
Example #3
0
File: editor.go Project: kego/ke
func (v *EditorView) Receive(notif flux.NotifPayload) {
	defer close(notif.Done)
	vecty.Rerender(v)
	if v.focus != nil && notif.Type == stores.NodeFocus {
		v.focus.Call("focus")
	}
}
Example #4
0
File: editor.go Project: kego/ke
func (v *IconEditorView) Receive(notif flux.NotifPayload) {
	defer close(notif.Done)
	v.icon = v.model.Node.Value.(*Icon)
	vecty.Rerender(v)
	if notif.Type == stores.NodeFocus {
		v.Focus()
	}
}
Example #5
0
File: panel.go Project: kego/ke
func (v *PanelView) Receive(notif flux.NotifPayload) {
	defer close(notif.Done)
	v.branch = v.App.Branches.Selected()
	v.node = v.App.Nodes.Selected()
	vecty.Rerender(v)
	if notif.Type == stores.BranchSelected {
		v.panel.Node.Get("parentNode").Set("scrollTop", "0")
	}
}
Example #6
0
func (v *EditorListView) Receive(notif flux.NotifPayload) {
	defer close(notif.Done)
	if v.sort && notif.Type == stores.NodeArrayReorder {
		js.Global.Call("$", v.container.Node).Call("sortable", "cancel")
	}
	vecty.Rerender(v)
	if v.sort {
		v.sortable()
	}
}
Example #7
0
File: addpop.go Project: kego/ke
func (v *AddPopupView) Receive(notif flux.NotifPayload) {
	defer close(notif.Done)
	v.model = v.App.Misc.AddPopup()
	vecty.Rerender(v)
	if v.model.Visible {
		js.Global.Call("$", "#add-modal").Call("modal", "show")
		if v.model.HasName() {
			js.Global.Call("$", "#add-modal-name").Call("focus")
		} else {
			js.Global.Call("$", "#add-modal-type").Call("focus")
		}
	} else {
		js.Global.Call("$", "#add-modal").Call("modal", "hide")
	}
}
Example #8
0
File: tree.go Project: kego/ke
func (v *TreeView) Receive(notif flux.NotifPayload) {
	defer close(notif.Done)
	v.Root = v.App.Branches.Root()
	vecty.Rerender(v)
}
Example #9
0
File: view.go Project: kego/ke
func (v *View) Receive(notif NotifPayload) {
	// ke: {"block": {"notest": true}}
	// Default receive function for when view doesn't override it
	defer close(notif.Done)
	vecty.Rerender(v.Self)
}