Single input emit on taginput taxonomy metadata.

This commit is contained in:
Mateus Machado Luna 2019-10-22 13:05:03 -03:00
parent 0ce1bc3e8e
commit 44337f4d99
2 changed files with 9 additions and 14 deletions

View File

@ -12,7 +12,7 @@
:options="getOptions(0)"/>
<a
class="add-new-term"
v-if="(this.getComponent == 'tainacan-taxonomy-checkbox' || this.getComponent == 'tainacan-taxonomy-radio') &&
v-if="(getComponent == 'tainacan-taxonomy-checkbox' || getComponent == 'tainacan-taxonomy-radio') &&
terms.length < totalTerms"
@click="openCheckboxModal()">
{{ $i18n.get('label_view_all') }}
@ -47,14 +47,12 @@
this.taxonomy_id = metadata_type_options.taxonomy_id;
this.taxonomy = metadata_type_options.taxonomy;
if( metadata_type_options && metadata_type_options.allow_new_terms && this.metadatum.item ){
if (metadata_type_options && metadata_type_options.allow_new_terms && this.metadatum.item)
this.allowNew = metadata_type_options.allow_new_terms == 'yes';
}
// This condition is temporary
if(this.component != 'tainacan-taxonomy-tag-input' || this.forcedComponentType != 'tainacan-taxonomy-tag-input'){
// This condition is temporary, used by bulk edition modal
if (this.component != 'tainacan-taxonomy-tag-input' || this.forcedComponentType != 'tainacan-taxonomy-tag-input')
this.getTermsFromTaxonomy();
}
this.getTermsId();
},
@ -80,7 +78,6 @@
},
watch: {
valueComponent( val ){
this.valueComponent = val;
this.$emit('input', val);
this.$emit('blur');
}

View File

@ -112,11 +112,10 @@
let val = this.selected;
let results = [];
if (val.length > 0){
for( let term of val ){
if (val.length > 0) {
for (let term of val)
results.push( term.value );
}
this.$emit('input', results);
this.$emit('blur');
}
@ -125,9 +124,8 @@
let val = this.selected;
let results = [];
for( let term of val ){
results.push( term.value );
}
for (let term of val)
results.push(term.value);
this.$emit('input', results);
this.$emit('blur');