Skip to content

Commit

Permalink
Merge pull request #6 from storediq/bhartel-defect-9227
Browse files Browse the repository at this point in the history
Bhartel defect 9227
  • Loading branch information
barbarahartel authored and GitHub Enterprise committed Sep 11, 2018
2 parents fbc709d + 8f8b20a commit 2ad8480
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/mixins/asinfinitescrollable.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,22 @@ define([
};
if (!this._getTotalModelCount) {
this._getTotalModelCount = function() {
// Fix for defect 11956:
// Only 100 items are listed on the Create Filter panel and the status in the filter list is missing
// 'collectionMap.call(this, collection.currentPage())' must be called in order
// to retrieve the items which are shown in the UI (the function might elimiates some items)
var collectionMap = this.get('collectionMap'),
collection = this.get('collection'),
uiColl;

if (collectionMap && collection) {
uiColl = collectionMap.call(this, collection.currentPage());
}
if (uiColl) {
// console.log("asinfinitescrollable.js-_getTotalModelCount - uicoll returned: " + uiColl.length);
return uiColl.length;
}
// console.log("asinfinitescrollable.js-_getTotalModelCount - retVal returned: " + retVal);
return this.get('collection.total') || this.get('data.length') || 0;
};
}
Expand All @@ -145,6 +161,7 @@ define([
// only 100 items where shown on the UI, the rest were ignored.
if (models.length == total) {
limit = total;
this.set('limit',limit);
}
// the offset can't be greater than the total-1imit
offset = Math.min(offset, total-limit);
Expand Down Expand Up @@ -177,6 +194,7 @@ define([
total = (this.get('models') || []).length,
windowCount = Math.ceil(total/limit) || 1,
currentWindow = Math.floor(offset/limit) + 1;
// console.log("asinfinitescrollable.js-_isLastWindowLoaded - offset: " + offset + " limit: " + limit + " total: " + total + " windowCount: " + windowCount + " currentWindow: " + currentWindow);
return currentWindow >= windowCount;
};
}
Expand Down

0 comments on commit 2ad8480

Please sign in to comment.