diff --git a/app_scripts.js b/app_scripts.js index 67e4252..7d8a0bc 100644 --- a/app_scripts.js +++ b/app_scripts.js @@ -1361,4 +1361,8 @@ function setTitleColor(color) { meta.setAttribute('name', 'theme-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}")); } \ No newline at end of file diff --git a/detailsView.go b/detailsView.go index e519f32..4bd42d9 100644 --- a/detailsView.go +++ b/detailsView.go @@ -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 { diff --git a/gridLayout.go b/gridLayout.go index 3313b63..c26ebbe 100644 --- a/gridLayout.go +++ b/gridLayout.go @@ -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. diff --git a/textView.go b/textView.go index 8751481..cb221bd 100644 --- a/textView.go +++ b/textView.go @@ -12,7 +12,6 @@ type TextView interface { type textViewData struct { viewData - // TODO textShadow } // NewTextView create new TextView object and return it