Fixed an issue where not all the results of the intersection observer were being checked.
This commit is contained in:
parent
939d1ec83a
commit
812f8352f5
@ -1511,10 +1511,15 @@ class IgniteTemplate {
|
||||
//Setup a intersect observer if needed
|
||||
if (this._intersectObserverCallback && this._intersectObserverCallback.length > 0) {
|
||||
this._intersectObserver = new IntersectionObserver(results => {
|
||||
if (results[0].isIntersecting) {
|
||||
for (var i = 0; i < this._intersectObserverCallback.length; i++) {
|
||||
if (this._intersectObserverCallback[i]) {
|
||||
this._intersectObserverCallback[i](results[0]);
|
||||
if (results) {
|
||||
for (var i = 0; i < results.length; i++) {
|
||||
if (results[i].isIntersecting && results[i].target == this.element) {
|
||||
for (var i2 = 0; i2 < this._intersectObserverCallback.length; i2++) {
|
||||
if (this._intersectObserverCallback[i2]) {
|
||||
this._intersectObserverCallback[i2](results[i]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user