(core) Hides the link icon in print view

Summary:
Users complained about white spaces left by the link icon when printing.
Diff fixes the issue by hiding link icon completely.

Test Plan: Adds tests in `nbrowser/Printing.ts`

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D3767
This commit is contained in:
Cyprien P
2023-01-18 17:43:39 +01:00
parent 1dafe4bae0
commit ca5ae6fa3f
4 changed files with 20 additions and 5 deletions

View File

@@ -64,7 +64,7 @@ export async function printViewSection(layout: any, viewSection: ViewSectionRec)
}
const sub1 = dom.onElem(window, 'beforeprint', () => prepareToPrint(true));
const sub2 = dom.onElem(window, 'afterprint', () => {
const sub2 = dom.onElem(window, 'afterprint', (window as any).afterPrintCallback = () => {
sub1.dispose();
sub2.dispose();
// To debug printing, set window.debugPrinting=1 in the console, then print a section, dismiss
@@ -75,6 +75,7 @@ export async function printViewSection(layout: any, viewSection: ViewSectionRec)
} else {
prepareToPrint(false);
}
delete (window as any).afterPrintCallback;
});
// Running print on a timeout makes it possible to test printing using selenium, and doesn't