Vs-excess not doing it's job
See original GitHub issueI’m attempting to use vs-excess in order to ensure enough items are in DOM to work around the virtual momentum scrolling issue. #40
Problem is, vs-excess is just not doing it’s job. No excess items are ever in DOM. Ideas?
HTML ANGULAR CODE
<!--GRID VIEW-->
<div vs-repeat class="inner-container" vs-excess="50" vs-size-property="rowHeight" vs-offset-before="77" on-vs-index-change="infiniteScroll(startIndex, endIndex)" ng-show="views.gridView">
<div ng-repeat="row in results.gridRows" style="width: 100%;">
<div ng-repeat="result in row.rowContents"
ng-click="openSplash(this)"
class="grid-item"
style="width: {{results.gridPercentageWidth}}%;"
>
//Add html here
</div>
</div>
</div>
JS CODE TO CALCUALTE AND BUILD RESPONSIVE GRID
factory.generateRows = function (results, reason, views) {
var numColumns;
//If user has gridView enabled calculate columns, else build list view.
if (views.gridView) {
var dimensions = factory.getInnerContainerDimensions();
var itemWidth = 290;
//console.log('width: ' + dimensions.w + '/' + itemWidth + ' equals...');
numColumns = Math.floor(dimensions.w / itemWidth);
factory.results.gridPercentageWidth = 100 / numColumns;
//console.log("Calculated " + numColumns + " columns at " + factory.results.gridPercentageWidth + "% width.");
} else {
numColumns = 1;
//console.log("List View: " + numColumns + " columns!");
}
if (numColumns !== factory.cachedColumnCalculation || reason === 'filter' || reason === 'pagination') {
factory.cachedColumnCalculation = numColumns;
//TODO: Don't clear all items just clear necessary ones??
factory.results.gridRows = [];
//Calculate the number of results with images and add up scroll height. This is used for virtual scrolling
for (var i = 0; i < results.length; i++) {
var rowHeight;
//If gridview is turned on they height is always 350
if (views.gridView) {
rowHeight = 390;
} else { //else the user is in list view. Height depends on whether result contains 2 or more images.
if(results[i].images.length === 0) {
rowHeight = 179;
} else if (results[i].images.length === 1) {
rowHeight = 261;
} else {
rowHeight = 420;
}
}
if (i % numColumns === 0) {
var row = {
rowHeight: rowHeight,
rowContents: []
};
for (var j = 0; j < numColumns; j++) {
if (i + j < results.length) {
//console.log(i + j);
if (results[i + j].askingPrice.value) {
factory.updatePriceSlider(results[i + j].askingPrice.value);
}
row.rowContents.push(results[i + j]);
}
}
factory.results.gridRows.push(row);
i = i + j - 1;
//console.log('Finshed row! New index is: ' + i);
}
}
console.log('Grid Rows: ', factory.results.gridRows);
}
};
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
20 Signs You're Overworked and Underpaid | Indeed.com
A key sign that you're overworked is if you've lost the passion you once felt for your position. If you no longer look...
Read more >Are You Being Taken Advantage of at Work? | Monster.com
Feeling unappreciated or like you're constantly being taken advantage of at work is absolutely not in anyone's job description. Cue the stress headaches....
Read more >Job burnout: How to spot it and take action - Mayo Clinic
Consequences of job burnout Ignored or unaddressed job burnout can have significant consequences, including: Excessive stress. Fatigue. Insomnia.
Read more >How to Say No to Taking on More Work
Sometimes you have too much on your plate or you're just not interested in taking on a project you've been asked to work...
Read more >7 Health Effects of Working Too Much - Healthline
Excessive stress can leave you feeling physically and mentally exhausted — even after 9 hours of sleep. You might find that it's taking...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Had the same problem with 1.0.0-rc5. Ended up fixing this by adding the following to
updateInnerCollection()
at line 387 (right beforevar digestRequired
definition):Resolved. Thank you!
On Tuesday, June 9, 2015, mato75 notifications@github.com wrote: