Add PDF state persistence
This commit is contained in:
@@ -18,6 +18,17 @@ export class MessageBridge {
|
||||
window.addEventListener("message", this._handler);
|
||||
}
|
||||
|
||||
/** Send the current viewer state (zoom + scroll) to the parent window. */
|
||||
postViewerState(refId, zoom, scrollTop) {
|
||||
if (window.parent === window) return;
|
||||
window.parent.postMessage({
|
||||
type: "brittle:viewer-state",
|
||||
refId,
|
||||
zoom,
|
||||
scrollTop,
|
||||
}, "*");
|
||||
}
|
||||
|
||||
/** Forward a keydown event to the parent window for global keybindings. */
|
||||
forwardKeydown(ev) {
|
||||
if (window.parent === window) return;
|
||||
|
||||
Reference in New Issue
Block a user