# HG changeset patch # User Alexandre Segura # Date 1486653564 -3600 # Node ID 33522d51b9dd3308429eedf1eea6a2cad9da716b # Parent 3cb75bbbb8b210519e2f7fd622564e136527614f Manage placeholder via props. diff -r 3cb75bbbb8b2 -r 33522d51b9dd src_js/iconolab-bundle/src/components/typeahead/Typeahead.vue --- a/src_js/iconolab-bundle/src/components/typeahead/Typeahead.vue Thu Feb 09 16:18:42 2017 +0100 +++ b/src_js/iconolab-bundle/src/components/typeahead/Typeahead.vue Thu Feb 09 16:19:24 2017 +0100 @@ -21,11 +21,11 @@ }).fail(dfd.reject); return dfd.promise(); } - + export default { mixins: [typeahead], components: { 'taglist' : Taglist }, - + props: ['tags', 'read-only'], mounted() { @@ -43,15 +43,15 @@ datasource: "wikipedia", selectedTags: "[]", items: [], - queryParamName: "QueryString" - + queryParamName: "QueryString", + placeholder: "..." } }, methods: { - + setTags(tags, reset) { - tags = Array.isArray(tags) ? tags : []; + tags = Array.isArray(tags) ? tags : []; reset = (typeof reset === "boolean") ? reset : false; if (reset) { this.taglist.reset(); @@ -64,7 +64,7 @@ this.reset(); } }, - + fetch() { if (this.datasource === "wikipedia") { return this.fetchWikiPedia(); @@ -73,7 +73,7 @@ else { var request = {}; request[this.queryParamName] = this.query; - return get(this.src, query); + return get(this.src, query); } }, @@ -87,7 +87,7 @@ }; /* make request */ - var dfd = jQuery.Deferred(); + var dfd = jQuery.Deferred(); jQuery.ajax({ url: this.src, data: request, @@ -132,13 +132,13 @@ prepareResponseData (data) { var responseData = (typeof data === 'string') ? JSON.parse(data): data; - + if(this.datasource === "wikipedia") { responseData = this.prepareWikipediaResponse(responseData); } if (Array.isArray(responseData) && !responseData.length) { - this.showAddButton = true; + this.showAddButton = true; } return responseData; }, @@ -158,4 +158,4 @@ } - \ No newline at end of file + diff -r 3cb75bbbb8b2 -r 33522d51b9dd src_js/iconolab-bundle/src/components/typeahead/template.html --- a/src_js/iconolab-bundle/src/components/typeahead/template.html Thu Feb 09 16:18:42 2017 +0100 +++ b/src_js/iconolab-bundle/src/components/typeahead/template.html Thu Feb 09 16:19:24 2017 +0100 @@ -1,8 +1,8 @@
- -
\ No newline at end of file +