cedaei.com/node_modules/@juggle/resize-observer/lib/algorithms/gatherActiveObservationsAtDepth.js
Ceda EI e186c5d6f7 Squashed 'themes/paperesque/' content from commit 228903d
git-subtree-dir: themes/paperesque
git-subtree-split: 228903d2bad09f92d4de8a2922806fafd24d3966
2020-10-09 23:41:57 +05:30

20 lines
764 B
JavaScript

import { resizeObservers } from '../utils/resizeObservers';
import { calculateDepthForNode } from './calculateDepthForNode';
var gatherActiveObservationsAtDepth = function (depth) {
resizeObservers.forEach(function processObserver(ro) {
ro.activeTargets.splice(0, ro.activeTargets.length);
ro.skippedTargets.splice(0, ro.skippedTargets.length);
ro.observationTargets.forEach(function processTarget(ot) {
if (ot.isActive()) {
if (calculateDepthForNode(ot.target) > depth) {
ro.activeTargets.push(ot);
}
else {
ro.skippedTargets.push(ot);
}
}
});
});
};
export { gatherActiveObservationsAtDepth };