angular2-virtual-scroll
Advanced tools
Comparing version 0.2.1 to 0.2.2
# v0.2.2 | ||
* Fixes #94 | ||
# v0.2.1 | ||
@@ -3,0 +7,0 @@ |
@@ -128,3 +128,6 @@ "use strict"; | ||
var itemsPerCol = Math.max(1, Math.floor(viewHeight / childHeight)); | ||
var scrollTop = Math.max(0, el.scrollTop); | ||
var elScrollTop = this.parentScroll instanceof Window | ||
? (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0) | ||
: el.scrollTop; | ||
var scrollTop = Math.max(0, elScrollTop); | ||
if (itemsPerCol === 1 && Math.floor(scrollTop / this.scrollHeight * itemCount) + itemsPerRowByCalc >= itemCount) { | ||
@@ -149,7 +152,10 @@ itemsPerRow = itemsPerRowByCalc; | ||
var offsetTop = this.getElementsOffset(); | ||
var elScrollTop = this.parentScroll instanceof Window | ||
? (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0) | ||
: el.scrollTop; | ||
this.scrollHeight = d.childHeight * d.itemCount / d.itemsPerRow; | ||
if (el.scrollTop > this.scrollHeight) { | ||
el.scrollTop = this.scrollHeight + offsetTop; | ||
if (elScrollTop > this.scrollHeight) { | ||
elScrollTop = this.scrollHeight + offsetTop; | ||
} | ||
var scrollTop = Math.max(0, el.scrollTop - offsetTop); | ||
var scrollTop = Math.max(0, elScrollTop - offsetTop); | ||
var indexByScrollTop = scrollTop / this.scrollHeight * d.itemCount / d.itemsPerRow; | ||
@@ -156,0 +162,0 @@ var end = Math.min(d.itemCount, Math.ceil(indexByScrollTop) * d.itemsPerRow + d.itemsPerRow * (d.itemsPerCol + 1)); |
{ | ||
"name": "angular2-virtual-scroll", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Angular 2 module for virtual -infinite- list. Supports multi-column", | ||
@@ -5,0 +5,0 @@ "main": "dist/virtual-scroll.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
332296
8938