diff --git a/src/views/feature/Feature_list.vue b/src/views/feature/Feature_list.vue index 42538f7d45a6d3d89d4d85acca5ba81fcb1b167f..e261289a6502641b4a61cd98f7c8492860a97ce7 100644 --- a/src/views/feature/Feature_list.vue +++ b/src/views/feature/Feature_list.vue @@ -394,50 +394,6 @@ export default { }, 1000); }, - handlePageChange(page) { - console.log("handlePageChange", page, typeof page); - if (page === "next") { - this.toNextPage(); - } else if (page === "previous") { - this.toPreviousPage(); - } else if (typeof page === "number") { - //* update limit and offset - this.toPage(page); - } - }, - - toPage(pageNumber) { - console.log("toPage", pageNumber); - const toAddOrRemove = - (pageNumber - this.pagination.currentPage) * this.pagination.pagesize; - this.pagination.start += toAddOrRemove; - this.pagination.end += toAddOrRemove; - this.pagination.currentPage = pageNumber; - this.updateFeatures(); - }, - - toPreviousPage() { - if (this.pagination.currentPage !== 1) { - if (this.pagination.start > 0) { - this.pagination.start -= this.pagination.pagesize; - this.pagination.end -= this.pagination.pagesize; - this.pagination.currentPage -= 1; - } - this.updateFeatures(this.previous); - } - }, - - toNextPage() { - if (this.pagination.currentPage !== this.pageNumbers.length) { - if (this.pagination.end < this.featuresCount) { - this.pagination.start += this.pagination.pagesize; - this.pagination.end += this.pagination.pagesize; - this.pagination.currentPage += 1; - } - this.updateFeatures(this.next); - } - }, - getFeatureTypeSlug(title) { const featureType = this.feature_types.find((el) => el.title === title); return featureType ? featureType.slug : null; @@ -518,13 +474,12 @@ export default { if (filterParams === "abort") return; url += filterParams; } else { - console.error("ONLYÂ FORÂ DEV !!!!!!!!!!!!!"); - params = params.replace("8000", "8010"); - console.log(url); + //console.error("ONLY FOR DEV !!!!!!!!!!!!!"); + //params = params.replace("8000", "8010"); + //console.log(url); url = params; } } - console.log("url -->", url); this.$store.commit( "DISPLAY_LOADER", @@ -582,6 +537,48 @@ export default { ), //* use Set to eliminate duplicate values ]; }, + + handlePageChange(page) { + if (page === "next") { + this.toNextPage(); + } else if (page === "previous") { + this.toPreviousPage(); + } else if (typeof page === "number") { + //* update limit and offset + this.toPage(page); + } + }, + + toPage(pageNumber) { + const toAddOrRemove = + (pageNumber - this.pagination.currentPage) * this.pagination.pagesize; + this.pagination.start += toAddOrRemove; + this.pagination.end += toAddOrRemove; + this.pagination.currentPage = pageNumber; + this.updateFeatures(); + }, + + toPreviousPage() { + if (this.pagination.currentPage !== 1) { + if (this.pagination.start > 0) { + this.pagination.start -= this.pagination.pagesize; + this.pagination.end -= this.pagination.pagesize; + this.pagination.currentPage -= 1; + } + this.updateFeatures(this.previous); + } + }, + + toNextPage() { + if (this.pagination.currentPage !== this.pageNumbers.length) { + if (this.pagination.end < this.featuresCount) { + this.pagination.start += this.pagination.pagesize; + this.pagination.end += this.pagination.pagesize; + this.pagination.currentPage += 1; + } + this.updateFeatures(this.next); + } + }, }, mounted() {