mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Implement 'Print widget' option to print individual view sections.
Summary: - Supports multi-page printing with some aggressive css overrides. - Relies on a new function implemented by grist-plugin-api to print a multi-page CustomView. - Renders all rows for printing for scrolly-based views. Test Plan: Doesn't seem possible to do a selenium test for printing. Tested manually on Chrome, Firefox, and Safari. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2635
This commit is contained in:
@@ -150,6 +150,11 @@ if (typeof window !== 'undefined') {
|
||||
rpc.setSendMessage(msg => window.parent.postMessage(msg, "*"));
|
||||
window.onmessage = (e: MessageEvent) => rpc.receiveMessage(e.data);
|
||||
}
|
||||
|
||||
// Allow outer Grist application to trigger printing. This is similar to using
|
||||
// iframe.contentWindow.print(), but that call does not work cross-domain.
|
||||
rpc.registerFunc("print", () => window.print());
|
||||
|
||||
} else if (typeof process === 'undefined') {
|
||||
// Web worker. We can't really bring in the types for WebWorker (available with --lib flag)
|
||||
// without conflicting with a regular window, so use just use `self as any` here.
|
||||
|
||||
Reference in New Issue
Block a user