dist/js/glightbox.js
function waitUntil(check, onComplete, delay, timeout) {
        if (check()) {
            onComplete();
            return;
        }

        if (!delay) delay = 100;
        var timeoutPointer = void 0;
        var intervalPointer = setInterval(function () {
            if (!check()) return;
            clearInterval(intervalPointer);
            if (timeoutPointer) clearTimeout(timeoutPointer);
            onComplete();
        }, delay);
        if (timeout) timeoutPointer = setTimeout(function () {
            clearInterval(intervalPointer);
        }, timeout);
    }
function waitUntil(check, onComplete, delay, timeout) {
        if (check()) {
            onComplete();
            return;
        }

        if (!delay) delay = 100;
        var timeoutPointer = void 0;
        var intervalPointer = setInterval(function () {
            if (!check()) return;
            clearInterval(intervalPointer);
            if (timeoutPointer) clearTimeout(timeoutPointer);
            onComplete();
        }, delay);
        if (timeout) timeoutPointer = setTimeout(function () {
            clearInterval(intervalPointer);
        }, timeout);
    }
function waitUntil ( check , onComplete , delay , timeout ) { if ( check ( ) ) { onComplete ( ) ; return ; } if ( ! delay ) delay = 100 ; var timeoutPointer = void 0 ; var intervalPointer = setInterval ( function ( ) { if ( ! check ( ) ) return ; clearInterval ( intervalPointer ) ; if ( timeoutPointer ) clearTimeout ( timeoutPointer ) ; onComplete ( ) ; } , delay ) ; if ( timeout ) timeoutPointer = setTimeout ( function ( ) { clearInterval ( intervalPointer ) ; } , timeout ) ; }
Wait until
wait until all the validations
are passed

@param {function} check
@param {function} onComplete
@param {numeric} delay
@param {numeric} timeout
Wait until wait until all the validations are passed