mirror of
https://github.com/Xevion/glance.git
synced 2025-12-09 16:07:20 -06:00
Allow changing max columns on split columns widget
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
{{ define "widget-content-classes" }}widget-content-frameless{{ end }}
|
||||
|
||||
{{ define "widget-content" }}
|
||||
<div class="masonry" data-max-columns="2">
|
||||
<div class="masonry" data-max-columns="{{ .MaxColumns }}">
|
||||
{{ range .Widgets }}
|
||||
{{ .Render }}
|
||||
{{ end }}
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
type SplitColumn struct {
|
||||
widgetBase `yaml:",inline"`
|
||||
containerWidgetBase `yaml:",inline"`
|
||||
MaxColumns int `yaml:"max-columns"`
|
||||
}
|
||||
|
||||
func (widget *SplitColumn) Initialize() error {
|
||||
@@ -22,6 +23,10 @@ func (widget *SplitColumn) Initialize() error {
|
||||
}
|
||||
}
|
||||
|
||||
if widget.MaxColumns < 2 {
|
||||
widget.MaxColumns = 2
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user