summaryrefslogtreecommitdiff
path: root/management/editor
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-12-20 09:03:13 -0800
committerSteve Manuel <nilslice@gmail.com>2016-12-20 09:03:13 -0800
commit9b7ee17fe3b43cedb151760215644591a6971d5a (patch)
tree5d431ea526179d08ee507735984e79f2afe230d4 /management/editor
parent1672f9d977f614b2d01f25fc625b62bfa287966d (diff)
fixing textarea element UI
Diffstat (limited to 'management/editor')
-rw-r--r--management/editor/elements.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/management/editor/elements.go b/management/editor/elements.go
index bb2cb3f..b536730 100644
--- a/management/editor/elements.go
+++ b/management/editor/elements.go
@@ -32,6 +32,15 @@ func Input(fieldName string, p interface{}, attrs map[string]string) []byte {
// The `fieldName` argument will cause a panic if it is not exactly the string
// form of the struct field that this editor input is representing
func Textarea(fieldName string, p interface{}, attrs map[string]string) []byte {
+ // add materialize css class to make UI correct
+ className := "materialize-textarea"
+ if _, ok := attrs["class"]; ok {
+ class := attrs["class"]
+ attrs["class"] = class + " " + className
+ } else {
+ attrs["class"] = className
+ }
+
e := newElement("textarea", attrs["label"], fieldName, p, attrs)
return domElement(e)