Merge branch 'develop' of https://github.com/tainacan/tainacan into develop

This commit is contained in:
mateuswetah 2018-08-02 21:42:04 -03:00
commit 14f5591640
2 changed files with 14 additions and 6 deletions

View File

@ -218,8 +218,6 @@
this.checkboxListOffset -= this.maxNumOptionsCheckboxList; this.checkboxListOffset -= this.maxNumOptionsCheckboxList;
this.noMorePage = 0; this.noMorePage = 0;
//console.log(this.checkboxListOffset, this.maxNumOptionsCheckboxList);
if(this.checkboxListOffset < 0){ if(this.checkboxListOffset < 0){
this.checkboxListOffset = 0; this.checkboxListOffset = 0;
} }
@ -230,12 +228,14 @@
}, },
nextPage(){ nextPage(){
if(!this.noMorePage) { 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.isCheckboxListLoading = true;
this.getOptions(this.checkboxListOffset); this.getOptions(this.checkboxListOffset);

View File

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