mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-15 21:22:43 +00:00
Replace print redirect with print contentWindow on all pages
This commit is contained in:
@@ -2,7 +2,12 @@ const React = require('react');
|
||||
const Nav = require('naturalcrit/nav/nav.jsx');
|
||||
|
||||
module.exports = function(props){
|
||||
return <Nav.item newTab={true} href={`/print/${props.shareId}?dialog=true`} color='purple' icon='far fa-file-pdf'>
|
||||
const printPage = () => {
|
||||
if (window.typeof !== 'undefined')
|
||||
window.frames['BrewRenderer'].contentWindow.print();
|
||||
};
|
||||
|
||||
return <Nav.item onClick={printPage} color='purple' icon='far fa-file-pdf'>
|
||||
get PDF
|
||||
</Nav.item>;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user