Support printing user's itinerary
- Define print.css with media=print type (note: could've been handled with @media queries) - Define printPage port to interop with window.print() JS function - Support UI.wrapNoPrint to wrap components with a the no-print CSS
This commit is contained in:
parent
699892883c
commit
803db7a5b2
5 changed files with 55 additions and 24 deletions
|
|
@ -4,7 +4,8 @@
|
|||
<meta charset="UTF-8" />
|
||||
<meta name="google-signin-client_id" content="580018768696-4beppspj6cu7rhjnfgok8lbmh9a4n3ok.apps.googleusercontent.com">
|
||||
<title>Elm SPA</title>
|
||||
<link rel="stylesheet" href="./output.css" />
|
||||
<link rel="stylesheet" type="text/css" href="./output.css" />
|
||||
<link rel="stylesheet" type="text/css" href="./print.css" media="print" />
|
||||
<script src="https://apis.google.com/js/platform.js" async defer></script>
|
||||
<script src="./Main.min.js"></script>
|
||||
</head>
|
||||
|
|
@ -27,7 +28,11 @@
|
|||
});
|
||||
}
|
||||
|
||||
Elm.Main.init({node: document.getElementById("mount")});
|
||||
var app = Elm.Main.init({node: document.getElementById("mount")});
|
||||
|
||||
app.ports.printPage.subscribe(function() {
|
||||
window.print();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue