# HG changeset patch # User Alexandre Segura # Date 1487954116 -3600 # Node ID d2187b1af744bdf35e92a96ebe0981cd45b38bbd # Parent 583a366e298cc173b4db24e4a4b2e02f48ffb880 Make custom tags work. diff -r 583a366e298c -r d2187b1af744 src_js/iconolab-bundle/src/components/tagform/Typeahead.vue --- a/src_js/iconolab-bundle/src/components/tagform/Typeahead.vue Fri Feb 24 16:56:30 2017 +0100 +++ b/src_js/iconolab-bundle/src/components/tagform/Typeahead.vue Fri Feb 24 17:35:16 2017 +0100 @@ -14,7 +14,8 @@ @input="update" /> @@ -59,7 +60,7 @@ src: autoCompletePath, limit: 7, minChars: 2, - showAddButton: false, + selectFirst: true, datasource: "wikipedia", selectedTags: "[]", items: [], @@ -112,7 +113,6 @@ }, reset () { - this.showAddButton = false; parentsMethods.reset.call(this); }, @@ -147,8 +147,14 @@ responseData = this.prepareWikipediaResponse(responseData); } + // When no tags found, create a custom tag if (Array.isArray(responseData) && !responseData.length) { - this.showAddButton = true; + return [{ + tag_label: this.query, + tag_link: this.query, + accuracy: null, + relevancy: null + }]; } return responseData; }, diff -r 583a366e298c -r d2187b1af744 src_js/iconolab-bundle/src/components/tagform/typeahead.css --- a/src_js/iconolab-bundle/src/components/tagform/typeahead.css Fri Feb 24 16:56:30 2017 +0100 +++ b/src_js/iconolab-bundle/src/components/tagform/typeahead.css Fri Feb 24 17:35:16 2017 +0100 @@ -51,8 +51,7 @@ border-radius: 0 0 4px 4px; border-bottom: 0; } -span { - display: block; +span.tag-label { color: #2c3e50; } .active {