forked from mbk-lab/rui_orig
2
0
Fork 0

Bug fixing

This commit is contained in:
Alexei Anoshenko 2022-06-17 19:26:24 +03:00
parent 3e0c153f20
commit 2eb1e383f2
9 changed files with 14 additions and 14 deletions

View File

@ -207,7 +207,7 @@ func (view *viewData) removeTransitionListener(tag string) {
delete(view.properties, tag)
if view.created {
if js, ok := transitionEvents[tag]; ok {
updateProperty(view.htmlID(), js.jsEvent, "", view.Session())
removeProperty(view.htmlID(), js.jsEvent, view.Session())
}
}
}
@ -287,7 +287,7 @@ func (view *viewData) removeAnimationListener(tag string) {
delete(view.properties, tag)
if view.created {
if js, ok := animationEvents[tag]; ok {
updateProperty(view.htmlID(), js.jsEvent, "", view.Session())
removeProperty(view.htmlID(), js.jsEvent, view.Session())
}
}
}

View File

@ -120,7 +120,7 @@ func (view *viewData) removeFocusListener(tag string) {
delete(view.properties, tag)
if view.created {
if js, ok := focusEvents[tag]; ok {
updateProperty(view.htmlID(), js.jsEvent, "", view.Session())
removeProperty(view.htmlID(), js.jsEvent, view.Session())
}
}
}

5
go.mod
View File

@ -2,7 +2,4 @@ module github.com/anoshenko/rui
go 1.17
require (
github.com/gorilla/websocket v1.5.0
github.com/webview/webview v0.0.0-20220603044542-dc41cdcc2961
)
require github.com/gorilla/websocket v1.5.0

2
go.sum
View File

@ -1,4 +1,2 @@
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/webview/webview v0.0.0-20220603044542-dc41cdcc2961 h1:T+zDKQvVOtbfrJwy8H1yn3ZtWuwbGu07aLih+qwFCsQ=
github.com/webview/webview v0.0.0-20220603044542-dc41cdcc2961/go.mod h1:rpXAuuHgyEJb6kXcXldlkOjU6y4x+YcASKKXJNUhh0Y=

View File

@ -204,7 +204,7 @@ func (view *viewData) removeKeyListener(tag string) {
delete(view.properties, tag)
if view.created {
if js, ok := keyEvents[tag]; ok {
updateProperty(view.htmlID(), js.jsEvent, "", view.Session())
removeProperty(view.htmlID(), js.jsEvent, view.Session())
}
}
}

View File

@ -304,7 +304,7 @@ func (view *viewData) removeMouseListener(tag string) {
delete(view.properties, tag)
if view.created {
if js, ok := mouseEvents[tag]; ok {
updateProperty(view.htmlID(), js.jsEvent, "", view.Session())
removeProperty(view.htmlID(), js.jsEvent, view.Session())
}
}
}

View File

@ -245,7 +245,7 @@ func (view *viewData) removePointerListener(tag string) {
delete(view.properties, tag)
if view.created {
if js, ok := pointerEvents[tag]; ok {
updateProperty(view.htmlID(), js.jsEvent, "", view.Session())
removeProperty(view.htmlID(), js.jsEvent, view.Session())
}
}
}

View File

@ -246,7 +246,7 @@ func (view *viewData) removeTouchListener(tag string) {
delete(view.properties, tag)
if view.created {
if js, ok := touchEvents[tag]; ok {
updateProperty(view.htmlID(), js.jsEvent, "", view.Session())
removeProperty(view.htmlID(), js.jsEvent, view.Session())
}
}
}

View File

@ -47,7 +47,12 @@ func SetChangeListener(view View, viewID, tag string, listener func(View, string
// true - all properties were set successful,
// false - error (incompatible type or invalid format of a string value, see AppLog).
func SetParams(rootView View, viewID string, params Params) bool {
view := ViewByID(rootView, viewID)
var view View
if viewID != "" {
view = ViewByID(rootView, viewID)
} else {
view = rootView
}
if view == nil {
return false
}