Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then( () => {
if ( formTheme === 'grid' || ( !formTheme && printHelper.isGrid() ) ) {
const paper = { format: settings.format, landscape: settings.landscape, scale: settings.scale, margin: settings.margin };
return printHelper.fixGrid( paper );
}
} )
.then( () => // allow some time for repainting
function printForm() {
const components = getPrintDialogComponents();
const texts = {
heading: components.heading,
msg: components.msg
};
const options = {
posButton: components.posButton,
negButton: components.negButton,
};
const inputs = components.gridInputs + components.gridWarning;
if ( formTheme === 'grid' || ( !formTheme && printHelper.isGrid() ) ) {
printHelper.openAllDetails();
return prompt( texts, options, inputs )
.then( values => {
if ( values ) {
printGrid( values );
}
} )
.then( printHelper.closeAllDetails );
} else {
printHelper.openAllDetails();
window.print();
printHelper.closeAllDetails();
return Promise.resolve();
}
}