diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-10-25 12:21:09 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-10-25 12:21:09 -0700 |
commit | af8f15263a87b1703c2e3618b5f5222dc486bc50 (patch) | |
tree | 8033015d35080dda30f83c8a4b88dcc1f58ed71c /management/editor/elements.go | |
parent | 048a4f390bd99386479d84792d24a78ffe443b4c (diff) |
debugging
Diffstat (limited to 'management/editor/elements.go')
-rw-r--r-- | management/editor/elements.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/management/editor/elements.go b/management/editor/elements.go index 1c0e7ed..e4dff73 100644 --- a/management/editor/elements.go +++ b/management/editor/elements.go @@ -344,8 +344,8 @@ func Tags(fieldName string, p interface{}, attrs map[string]string) []byte { tags := values.Slice(0, values.Len()).Interface().([]string) // casts reflect.Value to []string html := ` - <div class="input-field col s12 tags ` + name + `"> - <label class="active">` + attrs["label"] + `</label> + <div class="col s12 tags ` + name + `"> + <label class="active">` + attrs["label"] + ` (Type and press "Enter")</label> <div class="chips ` + name + `"></div> ` @@ -364,14 +364,15 @@ func Tags(fieldName string, p interface{}, attrs map[string]string) []byte { var tags = $('.tags.` + name + `'); $('.chips.` + name + `').material_chip({ data: [` + strings.Join(initial, ",") + `], - placeholder: 'Type and press "Enter" to add ` + name + `' + secondaryPlaceholder: '+'` + name + ` }); // handle events specific to tags var chips = tags.find('.chips'); chips.on('chip.add', function(e, chip) { - var input = $('<input>'); + console.log("id:", tags.find('input[type=hidden]').length-1); + var input = $('<Input>'); input.attr({ class: 'tag-'+chip.tag, name: '` + name + `.'+tags.find('input[type=hidden]').length-1, |