How to use the enketo-core/src/js/print.fixGrid function in enketo-core

To help you get started, we’ve selected a few enketo-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kobotoolbox / enketo-express / public / js / src / module / gui.js View on Github external
.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
github kobotoolbox / enketo-express / public / js / src / module / gui.js View on Github external
function printGrid( format ) {
    const swapped = printHelper.styleToAll();
    return printHelper.fixGrid( format )
        .then( window.print )
        .catch( console.error )
        .then( () => {
            if ( swapped ) {
                return new Promise( resolve => {
                    setTimeout( () => {
                        printHelper.styleReset();
                        resolve();
                    }, 500 );
                } );
            }
        } );
}