intersection-observer-admin
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -176,6 +176,10 @@ var __extends = (this && this.__extends) || (function () { | ||
var isIntersecting = entry.isIntersecting, intersectionRatio = entry.intersectionRatio; | ||
var threshold = options.threshold || 0; | ||
if (Array.isArray(threshold)) { | ||
threshold = threshold[threshold.length - 1]; | ||
} | ||
// then find entry's callback in static administration | ||
var matchingRootEntry = _this._findMatchingRootEntry(options); | ||
// first determine if entry intersecting | ||
if (isIntersecting) { | ||
// then find entry's callback in static administration | ||
var matchingRootEntry = _this._findMatchingRootEntry(options); | ||
if (isIntersecting || intersectionRatio > threshold) { | ||
if (matchingRootEntry) { | ||
@@ -191,5 +195,3 @@ matchingRootEntry.elements.some(function (element) { | ||
} | ||
else if (intersectionRatio <= 0) { | ||
// then find entry's callback in static administration | ||
var matchingRootEntry = _this._findMatchingRootEntry(options); | ||
else { | ||
if (matchingRootEntry) { | ||
@@ -196,0 +198,0 @@ matchingRootEntry.elements.some(function (element) { |
@@ -267,6 +267,10 @@ var Registry = /** @class */ (function () { | ||
var isIntersecting = entry.isIntersecting, intersectionRatio = entry.intersectionRatio; | ||
var threshold = options.threshold || 0; | ||
if (Array.isArray(threshold)) { | ||
threshold = threshold[threshold.length - 1]; | ||
} | ||
// then find entry's callback in static administration | ||
var matchingRootEntry = _this._findMatchingRootEntry(options); | ||
// first determine if entry intersecting | ||
if (isIntersecting) { | ||
// then find entry's callback in static administration | ||
var matchingRootEntry = _this._findMatchingRootEntry(options); | ||
if (isIntersecting || intersectionRatio > threshold) { | ||
if (matchingRootEntry) { | ||
@@ -282,5 +286,3 @@ matchingRootEntry.elements.some(function (element) { | ||
} | ||
else if (intersectionRatio <= 0) { | ||
// then find entry's callback in static administration | ||
var matchingRootEntry = _this._findMatchingRootEntry(options); | ||
else { | ||
if (matchingRootEntry) { | ||
@@ -287,0 +289,0 @@ matchingRootEntry.elements.some(function (element) { |
@@ -273,6 +273,10 @@ (function (global, factory) { | ||
var isIntersecting = entry.isIntersecting, intersectionRatio = entry.intersectionRatio; | ||
var threshold = options.threshold || 0; | ||
if (Array.isArray(threshold)) { | ||
threshold = threshold[threshold.length - 1]; | ||
} | ||
// then find entry's callback in static administration | ||
var matchingRootEntry = _this._findMatchingRootEntry(options); | ||
// first determine if entry intersecting | ||
if (isIntersecting) { | ||
// then find entry's callback in static administration | ||
var matchingRootEntry = _this._findMatchingRootEntry(options); | ||
if (isIntersecting || intersectionRatio > threshold) { | ||
if (matchingRootEntry) { | ||
@@ -288,5 +292,3 @@ matchingRootEntry.elements.some(function (element) { | ||
} | ||
else if (intersectionRatio <= 0) { | ||
// then find entry's callback in static administration | ||
var matchingRootEntry = _this._findMatchingRootEntry(options); | ||
else { | ||
if (matchingRootEntry) { | ||
@@ -293,0 +295,0 @@ matchingRootEntry.elements.some(function (element) { |
{ | ||
"name": "intersection-observer-admin", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Intersection Observer Admin for better performance", | ||
@@ -5,0 +5,0 @@ "main": "dist/intersection-observer-admin.umd.js", |
Sorry, the diff of this file is not supported yet
72901
1583