forked from mbk-lab/rui_orig
2
0
Fork 0

bug fixing

This commit is contained in:
anoshenko 2022-10-29 20:48:03 +03:00
parent d096a35af9
commit 45c798d14c
5 changed files with 20 additions and 20 deletions

View File

@ -585,9 +585,9 @@ func (player *mediaPlayerData) htmlProperties(self View, buffer *strings.Builder
if len(value) > 0 { if len(value) > 0 {
buffer.WriteString(` `) buffer.WriteString(` `)
buffer.WriteString(event.cssTag) buffer.WriteString(event.cssTag)
buffer.WriteString(`="playerEvent(this, \'`) buffer.WriteString(`="playerEvent(this, '`)
buffer.WriteString(event.tag) buffer.WriteString(event.tag)
buffer.WriteString(`\')"`) buffer.WriteString(`')"`)
} }
} }
} }

View File

@ -40,11 +40,7 @@ func updateCSSStyle(htmlID string, session Session) {
if !session.ignoreViewUpdates() { if !session.ignoreViewUpdates() {
if view := session.viewByHTMLID(htmlID); view != nil { if view := session.viewByHTMLID(htmlID); view != nil {
builder := viewCSSBuilder{buffer: allocStringBuilder()} builder := viewCSSBuilder{buffer: allocStringBuilder()}
//builder.buffer.WriteString(`updateCSSStyle('`)
//builder.buffer.WriteString(view.htmlID())
//builder.buffer.WriteString(`', '`)
view.cssStyle(view, &builder) view.cssStyle(view, &builder)
//builder.buffer.WriteString(`');`)
session.runFunc("updateCSSStyle", view.htmlID(), builder.finish()) session.runFunc("updateCSSStyle", view.htmlID(), builder.finish())
} }
} }

View File

@ -296,9 +296,9 @@ func (layout *stackLayoutData) Push(view View, animation int, onPushFinished fun
buffer.WriteString(`<div id="`) buffer.WriteString(`<div id="`)
buffer.WriteString(htmlID) buffer.WriteString(htmlID)
buffer.WriteString(`push" class="ruiStackPageLayout" ontransitionend="stackTransitionEndEvent(\'`) buffer.WriteString(`push" class="ruiStackPageLayout" ontransitionend="stackTransitionEndEvent('`)
buffer.WriteString(htmlID) buffer.WriteString(htmlID)
buffer.WriteString(`\', \'ruiPush\', event)" style="`) buffer.WriteString(`', 'ruiPush', event)" style="`)
switch layout.animationType { switch layout.animationType {
case StartToEndAnimation: case StartToEndAnimation:
@ -349,11 +349,11 @@ func (layout *stackLayoutData) Pop(animation int, onPopFinished func(View)) bool
buffer.WriteString(`<div id="`) buffer.WriteString(`<div id="`)
buffer.WriteString(htmlID) buffer.WriteString(htmlID)
buffer.WriteString(`pop" class="ruiStackPageLayout" ontransitionend="stackTransitionEndEvent(\'`) buffer.WriteString(`pop" class="ruiStackPageLayout" ontransitionend="stackTransitionEndEvent('`)
buffer.WriteString(htmlID) buffer.WriteString(htmlID)
buffer.WriteString(`\', \'ruiPop\', event)" ontransitioncancel="stackTransitionEndEvent(\'`) buffer.WriteString(`', 'ruiPop', event)" ontransitioncancel="stackTransitionEndEvent('`)
buffer.WriteString(htmlID) buffer.WriteString(htmlID)
buffer.WriteString(`\', \'ruiPop\', event)" style="transition: transform 1s ease;">`) buffer.WriteString(`', 'ruiPop', event)" style="transition: transform 1s ease;">`)
viewHTML(layout.popView, buffer) viewHTML(layout.popView, buffer)
buffer.WriteString(`</div>`) buffer.WriteString(`</div>`)

View File

@ -766,13 +766,13 @@ func (tabsLayout *tabsLayoutData) htmlSubviews(self View, buffer *strings.Builde
} else { } else {
buffer.WriteString(inactiveStyle) buffer.WriteString(inactiveStyle)
} }
buffer.WriteString(`" tabindex="0" onclick="tabClickEvent(this, \'`) buffer.WriteString(`" tabindex="0" onclick="tabClickEvent(this, '`)
buffer.WriteString(tabsLayoutID) buffer.WriteString(tabsLayoutID)
buffer.WriteString(`\', `) buffer.WriteString(`', `)
buffer.WriteString(strconv.Itoa(n)) buffer.WriteString(strconv.Itoa(n))
buffer.WriteString(`, event)" onkeydown="tabKeyClickEvent(\'`) buffer.WriteString(`, event)" onkeydown="tabKeyClickEvent('`)
buffer.WriteString(tabsLayoutID) buffer.WriteString(tabsLayoutID)
buffer.WriteString(`\', `) buffer.WriteString(`', `)
buffer.WriteString(strconv.Itoa(n)) buffer.WriteString(strconv.Itoa(n))
buffer.WriteString(`, event)" style="`) buffer.WriteString(`, event)" style="`)
buffer.WriteString(tabStyle) buffer.WriteString(tabStyle)
@ -808,13 +808,13 @@ func (tabsLayout *tabsLayoutData) htmlSubviews(self View, buffer *strings.Builde
close = closeButton close = closeButton
} }
if close { if close {
buffer.WriteString(`<div class="ruiTabCloseButton" tabindex="0" onclick="tabCloseClickEvent(this, \'`) buffer.WriteString(`<div class="ruiTabCloseButton" tabindex="0" onclick="tabCloseClickEvent(this, '`)
buffer.WriteString(tabsLayoutID) buffer.WriteString(tabsLayoutID)
buffer.WriteString(`\', `) buffer.WriteString(`', `)
buffer.WriteString(strconv.Itoa(n)) buffer.WriteString(strconv.Itoa(n))
buffer.WriteString(`, event)" onkeydown="tabCloseKeyClickEvent(\'`) buffer.WriteString(`, event)" onkeydown="tabCloseKeyClickEvent('`)
buffer.WriteString(tabsLayoutID) buffer.WriteString(tabsLayoutID)
buffer.WriteString(`\', `) buffer.WriteString(`', `)
buffer.WriteString(strconv.Itoa(n)) buffer.WriteString(strconv.Itoa(n))
buffer.WriteString(`, event)" style="display: grid; `) buffer.WriteString(`, event)" style="display: grid; `)

View File

@ -123,7 +123,11 @@ func (brige *wsBrige) runFunc(funcName string, args ...any) bool {
} }
brige.buffer.WriteString(");") brige.buffer.WriteString(");")
if err := brige.conn.WriteMessage(websocket.TextMessage, []byte(brige.buffer.String())); err != nil { funcText := brige.buffer.String()
if ProtocolInDebugLog {
DebugLog("Run func: " + funcText)
}
if err := brige.conn.WriteMessage(websocket.TextMessage, []byte(funcText)); err != nil {
ErrorLog(err.Error()) ErrorLog(err.Error())
return false return false
} }