MCPcopy
hub / github.com/tmcw/big / onResize

Function onResize

lib/big.js:535–552  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

533 }
534
535 function onResize() {
536 if (big.mode !== "talk") return;
537 var documentElement = document.documentElement;
538 if (!documentElement) {
539 throw new Error(
540 "document.documentElement not found, this environment is weird"
541 );
542 }
543 var width = documentElement.clientWidth;
544 var height = documentElement.clientHeight;
545 // Too wide
546 if (width / height > ASPECT_RATIO) {
547 width = Math.ceil(height * ASPECT_RATIO);
548 } else {
549 height = Math.ceil(width / ASPECT_RATIO);
550 }
551 resizeTo(slideDivs[big.current], width, height);
552 }
553});

Callers 1

goFunction · 0.85

Calls 1

resizeToFunction · 0.85

Tested by

no test coverage detected