# HG changeset patch # User Alexandre Segura # Date 1488293433 -3600 # Node ID 3d9a9de54bc0537c4428e84bf6859570a75d94dc # Parent 380450f0ca006b6b9556490431664d3de6f24999 Allow not specifying accuracy & relevancy in tags. diff -r 380450f0ca00 -r 3d9a9de54bc0 src_js/iconolab-bundle/src/components/tagform/ColorButtons.vue --- a/src_js/iconolab-bundle/src/components/tagform/ColorButtons.vue Mon Feb 27 19:08:52 2017 +0100 +++ b/src_js/iconolab-bundle/src/components/tagform/ColorButtons.vue Tue Feb 28 15:50:33 2017 +0100 @@ -64,6 +64,9 @@ if (this.originalValue === null) { this.value = null; } + if (this.originalValue === 0) { + this.value = 0; + } return; } diff -r 380450f0ca00 -r 3d9a9de54bc0 src_js/iconolab-bundle/src/components/tagform/TagList.vue --- a/src_js/iconolab-bundle/src/components/tagform/TagList.vue Mon Feb 27 19:08:52 2017 +0100 +++ b/src_js/iconolab-bundle/src/components/tagform/TagList.vue Tue Feb 28 15:50:33 2017 +0100 @@ -49,6 +49,11 @@ }, tags: function(tags) { this.$emit('change', { tags: tags }); + }, + readonly: function(readonly) { + if (readonly) { + this.hideAll(); + } } }, mounted() { diff -r 380450f0ca00 -r 3d9a9de54bc0 src_js/iconolab-bundle/src/components/tagform/TagListItem.vue --- a/src_js/iconolab-bundle/src/components/tagform/TagListItem.vue Mon Feb 27 19:08:52 2017 +0100 +++ b/src_js/iconolab-bundle/src/components/tagform/TagListItem.vue Tue Feb 28 15:50:33 2017 +0100 @@ -90,7 +90,7 @@ $(this.$el).find('.collapse').collapse({ toggle: false }); - if (this.isNew) { + if (!this.$parent.readonly && this.isNew) { this.$parent.hideAll(); this.show(); this.$refs.accuracy.animate(); diff -r 380450f0ca00 -r 3d9a9de54bc0 src_js/iconolab-bundle/src/components/tagform/Typeahead.vue --- a/src_js/iconolab-bundle/src/components/tagform/Typeahead.vue Mon Feb 27 19:08:52 2017 +0100 +++ b/src_js/iconolab-bundle/src/components/tagform/Typeahead.vue Tue Feb 28 15:50:33 2017 +0100 @@ -133,8 +133,8 @@ var link = urlsList[index]; link = link.replace("https://fr.wikipedia.org/wiki/", "http://fr.dbpedia.org/resource/"); tagItem.tag_link = decodeURI(link); - tagItem.accuracy = null; - tagItem.relevancy = null; + tagItem.accuracy = 0; + tagItem.relevancy = 0; results.push(tagItem); }); @@ -153,8 +153,8 @@ return [{ tag_label: this.query, tag_link: this.query, - accuracy: null, - relevancy: null + accuracy: 0, + relevancy: 0 }]; } return responseData;