(factor: number | null)
| 588 | } |
| 589 | |
| 590 | setZoomFactor(factor: number | null) { |
| 591 | // null is ok (will reset to default) |
| 592 | if (factor != null && factor < 0.1) { |
| 593 | factor = 0.1; |
| 594 | } |
| 595 | if (factor != null && factor > 5) { |
| 596 | factor = 5; |
| 597 | } |
| 598 | const domReady = globalStore.get(this.domReady); |
| 599 | if (!domReady) { |
| 600 | return; |
| 601 | } |
| 602 | this.webviewRef.current?.setZoomFactor(factor || 1); |
| 603 | this.env.rpc.SetMetaCommand(TabRpcClient, { |
| 604 | oref: makeORef("block", this.blockId), |
| 605 | meta: { "web:zoom": factor }, // allow null so we can remove the zoom factor here |
| 606 | }); |
| 607 | } |
| 608 | |
| 609 | getSettingsMenuItems(): ContextMenuItem[] { |
| 610 | const zoomSubMenu: ContextMenuItem[] = []; |
no test coverage detected