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 {
buffer.WriteString(` `)
buffer.WriteString(event.cssTag)
buffer.WriteString(`="playerEvent(this, \'`)
buffer.WriteString(`="playerEvent(this, '`)
buffer.WriteString(event.tag)
buffer.WriteString(`\')"`)
buffer.WriteString(`')"`)
}
}
}

View File

@ -40,11 +40,7 @@ func updateCSSStyle(htmlID string, session Session) {
if !session.ignoreViewUpdates() {
if view := session.viewByHTMLID(htmlID); view != nil {
builder := viewCSSBuilder{buffer: allocStringBuilder()}
//builder.buffer.WriteString(`updateCSSStyle('`)
//builder.buffer.WriteString(view.htmlID())
//builder.buffer.WriteString(`', '`)
view.cssStyle(view, &builder)
//builder.buffer.WriteString(`');`)
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(htmlID)
buffer.WriteString(`push" class="ruiStackPageLayout" ontransitionend="stackTransitionEndEvent(\'`)
buffer.WriteString(`push" class="ruiStackPageLayout" ontransitionend="stackTransitionEndEvent('`)
buffer.WriteString(htmlID)
buffer.WriteString(`\', \'ruiPush\', event)" style="`)
buffer.WriteString(`', 'ruiPush', event)" style="`)
switch layout.animationType {
case StartToEndAnimation:
@ -349,11 +349,11 @@ func (layout *stackLayoutData) Pop(animation int, onPopFinished func(View)) bool
buffer.WriteString(`<div id="`)
buffer.WriteString(htmlID)
buffer.WriteString(`pop" class="ruiStackPageLayout" ontransitionend="stackTransitionEndEvent(\'`)
buffer.WriteString(`pop" class="ruiStackPageLayout" ontransitionend="stackTransitionEndEvent('`)
buffer.WriteString(htmlID)
buffer.WriteString(`\', \'ruiPop\', event)" ontransitioncancel="stackTransitionEndEvent(\'`)
buffer.WriteString(`', 'ruiPop', event)" ontransitioncancel="stackTransitionEndEvent('`)
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)
buffer.WriteString(`</div>`)

View File

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

View File

@ -123,7 +123,11 @@ func (brige *wsBrige) runFunc(funcName string, args ...any) bool {
}
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())
return false
}