| 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 | }); |