MCPcopy
hub / github.com/marcj/css-element-queries / reset

Function reset

src/ResizeSensor.js:236–257  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

234 };
235
236 var reset = function() {
237 // Check if element is hidden
238 if (initialHiddenCheck) {
239 var invisible = element.offsetWidth === 0 && element.offsetHeight === 0;
240 if (invisible) {
241 // Check in next frame
242 if (!lastAnimationFrameForInvisibleCheck){
243 lastAnimationFrameForInvisibleCheck = requestAnimationFrame(function(){
244 lastAnimationFrameForInvisibleCheck = 0;
245 reset();
246 });
247 }
248
249 return;
250 } else {
251 // Stop checking
252 initialHiddenCheck = false;
253 }
254 }
255
256 resetExpandShrink();
257 };
258 element.resizeSensor.resetSensor = reset;
259
260 var onResized = function() {

Callers 2

onScrollFunction · 0.85
attachResizeEventFunction · 0.85

Calls 1

resetExpandShrinkFunction · 0.85

Tested by

no test coverage detected