From 00968e11ea5ad0574ca2760d8fc8d9604e620176 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Mon, 19 Sep 2016 02:27:09 -0700 Subject: refactoring elements.go labeling --- management/editor/elements.go | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) (limited to 'management') diff --git a/management/editor/elements.go b/management/editor/elements.go index 59d74f0..da63f39 100644 --- a/management/editor/elements.go +++ b/management/editor/elements.go @@ -10,16 +10,9 @@ import ( // 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 Input(fieldName string, p interface{}, attrs map[string]string) []byte { - var wrapInLabel = true - label, found := attrs["label"] - if !found { - wrapInLabel = false - label = "" - } - - e := newElement("input", label, fieldName, p, attrs) + e := newElement("input", attrs["label"], fieldName, p, attrs) - return domElementSelfClose(e, wrapInLabel) + return domElementSelfClose(e) } // Textarea returns the []byte of a