diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-12-05 12:21:17 -0800 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-12-05 12:21:17 -0800 |
commit | f5f1391bf2b661f14182d2827345481c0770cf3f (patch) | |
tree | 5df54aabf9d77e4308ddc3faa61131c5e0cf202f | |
parent | 24cfc1511d160850a6fc5c93be067c6704892440 (diff) |
adding test fix to Tags input element when added to existing content type
-rw-r--r-- | management/editor/elements.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/management/editor/elements.go b/management/editor/elements.go index 4a95150..0f48400 100644 --- a/management/editor/elements.go +++ b/management/editor/elements.go @@ -386,9 +386,11 @@ func Tags(fieldName string, p interface{}, attrs map[string]string) []byte { chips.on('chip.delete', function(e, chip) { // convert tag string to class-like selector "some tag" -> ".some.tag" - var sel = '.__ponzu-tag.'+chip.tag.split(' ').join('.'); - console.log(sel); - console.log(chips.parent().find(sel)); + var sel = '.__ponzu-tag'; + if (chip.tag.length > 0) { + sel += '.'; + sel += chip.tag.split(' ').join('.'); + } chips.parent().find(sel).remove(); // iterate through all hidden tag inputs to re-name them with the correct ` + name + `.index |