Files
CutList/CutList.Web/Components/App.razor
AJ Isaacs bf6c4764ed feat: Add custom print title JS function
Adds printWithTitle function to set document title before printing for
better file naming when saving as PDF.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 23:56:37 -05:00

36 lines
1.1 KiB
Plaintext

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="/" />
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
<link rel="stylesheet" href="css/app.css" />
<link rel="stylesheet" href="css/report.css" />
<link rel="stylesheet" href="CutList.Web.styles.css" />
<link rel="icon" type="image/png" href="favicon.png" />
<HeadOutlet @rendermode="InteractiveServer" />
</head>
<body>
<Routes @rendermode="InteractiveServer" />
<script src="_framework/blazor.web.js"></script>
<script>
function printWithTitle(title) {
const originalTitle = document.title;
document.title = title;
const restoreTitle = () => {
document.title = originalTitle;
window.removeEventListener('afterprint', restoreTitle);
};
window.addEventListener('afterprint', restoreTitle);
window.print();
}
</script>
</body>
</html>