Removes item from collection breadcrumb to avoid clicking on link that doesn't redirects to any route.

This commit is contained in:
Mateus Machado Luna 2018-10-17 10:34:29 -03:00
parent a9e3e73167
commit 2868eff56a
2 changed files with 6 additions and 2 deletions

View File

@ -205,7 +205,7 @@ export default {
switch(this.arrayRealPath[i-1]) { switch(this.arrayRealPath[i-1]) {
case 'collections': case 'collections':
this.fetchCollectionNameAndURL(this.arrayRealPath[i]) this.fetchCollectionNameAndURL(this.arrayRealPath[i])
.then(collection => this.arrayViewPath.splice(i, 1, collection.name)) .then(collection => { this.arrayViewPath.splice(i, 1, collection.name); })
.catch((error) => this.$console.error(error)); .catch((error) => this.$console.error(error));
break; break;
@ -240,6 +240,11 @@ export default {
} }
} }
let itemsIndex = this.arrayViewPath.findIndex(viewItem => viewItem == this.$i18n.get('items'));
if (itemsIndex >= 0 && itemsIndex == this.arrayRealPath.length - 1) {
this.arrayViewPath.splice(itemsIndex, 1);
}
} }
}, },
created() { created() {

View File

@ -316,7 +316,6 @@ export default {
'termId': this.termId, 'termId': this.termId,
'taxonomy': this.taxonomy 'taxonomy': this.taxonomy
}).then((resp) => { }).then((resp) => {
// The actual fetch item request // The actual fetch item request
resp.request.then((res) => { resp.request.then((res) => {
this.$emit( 'isLoadingItems', false); this.$emit( 'isLoadingItems', false);