Prevent a bug that cause a not correct exhibition of filter chechbox options in filter sidebar

This commit is contained in:
weryques 2018-08-09 10:17:44 -03:00
parent 0ac11c2a70
commit 432b5a98d2
3 changed files with 21 additions and 0 deletions

View File

@ -200,6 +200,7 @@
}
},
created() {
console.log(this);
if(this.isTaxonomy) {
this.getOptionChildren();
} else {

View File

@ -114,8 +114,24 @@
this.metadatum_object.metadata_type_options.collection_id : this.collection_id;
promise = this.getValuesRelationship( collectionTarget, null, [], 0, this.filter.max_options);
promise.then(() => {
if(this.options.length > this.filter.max_options){
this.options.splice(this.filter.max_options);
}
}).catch((error) => {
this.$console.error(error);
})
} else {
promise = this.getValuesPlainText( this.metadatum, null, this.isRepositoryLevel, [], 0, this.filter.max_options );
promise.then(() => {
if(this.options.length > this.filter.max_options){
this.options.splice(this.filter.max_options);
}
}).catch((error) => {
this.$console.error(error);
})
}
promise.then(() => {

View File

@ -150,6 +150,10 @@
}
if(this.filter.max_options && result.length >= this.filter.max_options){
if(this.options.length > this.filter.max_options){
this.options.splice(this.filter.max_options);
}
let seeMoreLink = `<a style="font-size: 12px;"> ${ this.$i18n.get('label_view_all') } </a>`;
result[this.filter.max_options-1].seeMoreLink = seeMoreLink;
}