Improve pagination interface (issue #83)

This commit is contained in:
weryques 2018-08-02 21:26:02 -03:00
parent a7c169f8dd
commit 3146cad4c6
2 changed files with 14 additions and 6 deletions

View File

@ -218,8 +218,6 @@
this.checkboxListOffset -= this.maxNumOptionsCheckboxList;
this.noMorePage = 0;
//console.log(this.checkboxListOffset, this.maxNumOptionsCheckboxList);
if(this.checkboxListOffset < 0){
this.checkboxListOffset = 0;
}
@ -230,12 +228,14 @@
},
nextPage(){
if(!this.noMorePage) {
this.checkboxListOffset += this.maxNumOptionsCheckboxList - 1;
// LIMIT 0, 20 / LIMIT 19, 20 / LIMIT 39, 20 / LIMIT 59, 20
if(this.checkboxListOffset === this.maxNumOptionsCheckboxList){
this.checkboxListOffset += this.maxNumOptionsCheckboxList-1;
} else {
this.checkboxListOffset += this.maxNumOptionsCheckboxList;
}
}
// 0 20 / 19 20 / 39 20 / 59 20
//console.log(this.checkboxListOffset, this.maxNumOptionsCheckboxList);
this.isCheckboxListLoading = true;
this.getOptions(this.checkboxListOffset);

View File

@ -80,6 +80,10 @@ export const filter_type_mixin = {
this.noMorePage = 1;
}
if(this.options.length < this.maxNumOptionsCheckboxList){
this.noMorePage = 1;
}
if (this.filter.max_options && this.options.length >= this.filter.max_options) {
let seeMoreLink = `<a style="font-size: 12px;"> ${ this.$i18n.get('label_see_more') } </a>`;
this.options[this.filter.max_options - 1].seeMoreLink = seeMoreLink;
@ -151,6 +155,10 @@ export const filter_type_mixin = {
this.noMorePage = 1;
}
if(this.options.length < this.maxNumOptionsCheckboxList){
this.noMorePage = 1;
}
if (this.filter.max_options && this.options.length >= this.filter.max_options) {
let seeMoreLink = `<a style="font-size: 12px;"> ${ this.$i18n.get('label_see_more') } </a>`;
this.options[this.filter.max_options - 1].seeMoreLink = seeMoreLink;