From 2eb1e383f23f9d679e031f72397eb6a9905f9a71 Mon Sep 17 00:00:00 2001 From: Alexei Anoshenko Date: Fri, 17 Jun 2022 19:26:24 +0300 Subject: [PATCH] Bug fixing --- animationEvents.go | 4 ++-- focusEvents.go | 2 +- go.mod | 5 +---- go.sum | 2 -- keyEvents.go | 2 +- mouseEvents.go | 2 +- pointerEvents.go | 2 +- touchEvents.go | 2 +- viewUtils.go | 7 ++++++- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/animationEvents.go b/animationEvents.go index 1ba9e52..391c09d 100644 --- a/animationEvents.go +++ b/animationEvents.go @@ -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()) } } } diff --git a/focusEvents.go b/focusEvents.go index 6a52c07..025c702 100644 --- a/focusEvents.go +++ b/focusEvents.go @@ -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()) } } } diff --git a/go.mod b/go.mod index 607833d..ff93f55 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index b098a74..e5a03d4 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/keyEvents.go b/keyEvents.go index 2240262..15762b2 100644 --- a/keyEvents.go +++ b/keyEvents.go @@ -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()) } } } diff --git a/mouseEvents.go b/mouseEvents.go index 31cb823..bbfe76f 100644 --- a/mouseEvents.go +++ b/mouseEvents.go @@ -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()) } } } diff --git a/pointerEvents.go b/pointerEvents.go index b97e261..12ec35b 100644 --- a/pointerEvents.go +++ b/pointerEvents.go @@ -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()) } } } diff --git a/touchEvents.go b/touchEvents.go index 63f7a28..2deeed1 100644 --- a/touchEvents.go +++ b/touchEvents.go @@ -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()) } } } diff --git a/viewUtils.go b/viewUtils.go index 299e1a3..a782472 100644 --- a/viewUtils.go +++ b/viewUtils.go @@ -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 }