How to use the enketo-core/src/js/support.touch 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
initTranslator()
        .then( setEventHandlers );

    // avoid Windows console errors
    if ( typeof window.console === 'undefined' ) {
        window.console = {
            log() {}
        };
    }
    if ( typeof window.console.debug === 'undefined' ) {
        console.debug = console.log;
    }

    // override feature detection (for development purposes)
    if ( settings.touch ) {
        support.touch = true;
        $( 'html' ).addClass( 'touch' );
    } else if ( settings.touch === false ) {
        support.touch = false;
        $( 'html' ).removeClass( 'touch' );
    }
}
github kobotoolbox / enketo-express / public / js / src / module / gui.js View on Github external
function feedback( message, duration ) {
    if ( !support.touch ) {
        feedbackBar.show( message, duration );
    } else {
        alert( message, t( 'feedback.header' ), 'info', duration );
    }
}