forked from mbk-lab/rui_orig
Added detailsView expand event
This commit is contained in:
parent
36e6d0a389
commit
76ff9a38fb
|
@ -1362,3 +1362,7 @@ function setTitleColor(color) {
|
|||
meta.setAttribute('content', color);
|
||||
document.getElementsByTagName('head')[0].appendChild(meta);
|
||||
}
|
||||
|
||||
function detailsEvent(element) {
|
||||
sendMessage("details-open{session=" + sessionID + ",id=" + element.id + ",open=" + (element.open ? "1}" : "0}"));
|
||||
}
|
|
@ -128,6 +128,7 @@ func (detailsView *detailsViewData) htmlTag() string {
|
|||
|
||||
func (detailsView *detailsViewData) htmlProperties(self View, buffer *strings.Builder) {
|
||||
detailsView.viewsContainerData.htmlProperties(self, buffer)
|
||||
buffer.WriteString(` ontoggle="detailsEvent(this)"`)
|
||||
if IsDetailsExpanded(detailsView, "") {
|
||||
buffer.WriteString(` open`)
|
||||
}
|
||||
|
@ -151,6 +152,17 @@ func (detailsView *detailsViewData) htmlSubviews(self View, buffer *strings.Buil
|
|||
detailsView.viewsContainerData.htmlSubviews(self, buffer)
|
||||
}
|
||||
|
||||
func (detailsView *detailsViewData) handleCommand(self View, command string, data DataObject) bool {
|
||||
if command == "details-open" {
|
||||
if n, ok := dataIntProperty(data, "open"); ok {
|
||||
detailsView.properties[Expanded] = (n != 0)
|
||||
detailsView.propertyChangedEvent(Expanded)
|
||||
}
|
||||
return true
|
||||
}
|
||||
return detailsView.viewsContainerData.handleCommand(self, command, data)
|
||||
}
|
||||
|
||||
// GetDetailsSummary returns a value of the Summary property of DetailsView.
|
||||
// If the second argument (subviewID) is "" then a value from the first argument (view) is returned.
|
||||
func GetDetailsSummary(view View, subviewID string) View {
|
||||
|
|
|
@ -312,10 +312,11 @@ func gridCellSizes(properties Properties, tag string, session Session) []SizeUni
|
|||
return []SizeUnit{}
|
||||
}
|
||||
|
||||
/*
|
||||
func (gridLayout *gridLayoutData) cssStyle(self View, builder cssBuilder) {
|
||||
gridLayout.viewsContainerData.cssStyle(self, builder)
|
||||
// TODO
|
||||
}
|
||||
*/
|
||||
|
||||
// GetCellVerticalAlign returns the vertical align of a GridLayout cell content: TopAlign (0), BottomAlign (1), CenterAlign (2), StretchAlign (3)
|
||||
// If the second argument (subviewID) is "" then a value from the first argument (view) is returned.
|
||||
|
|
|
@ -12,7 +12,6 @@ type TextView interface {
|
|||
|
||||
type textViewData struct {
|
||||
viewData
|
||||
// TODO textShadow
|
||||
}
|
||||
|
||||
// NewTextView create new TextView object and return it
|
||||
|
|
Loading…
Reference in New Issue