How to use the enketo-core/src/js/print.isGrid 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 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();
    }
}