dist/crocodoc.viewer.js
function shouldUseZoomLevel(zoomLevel) {
                var similarity = lastZoomLevel / zoomLevel;
                // remove duplicates
                if (zoomLevel === lastZoomLevel) {
                    return false;
                }
                // keep anything that is within the similarity threshold
                if (similarity < ZOOM_LEVEL_SIMILARITY_THRESHOLD) {
                    return true;
                }
                // check if it's a preset
                if (util.inArray(zoomLevel, presets) > -1) {
                    // keep presets if they are within a higher threshold
                    if (similarity < ZOOM_LEVEL_PRESETS_SIMILARITY_THRESHOLD) {
                        return true;
                    }
                }
                return false;
            }
function shouldUseZoomLevel(zoomLevel) {
                var similarity = lastZoomLevel / zoomLevel;
                // remove duplicates
                if (zoomLevel === lastZoomLevel) {
                    return false;
                }
                // keep anything that is within the similarity threshold
                if (similarity < ZOOM_LEVEL_SIMILARITY_THRESHOLD) {
                    return true;
                }
                // check if it's a preset
                if (util.inArray(zoomLevel, presets) > -1) {
                    // keep presets if they are within a higher threshold
                    if (similarity < ZOOM_LEVEL_PRESETS_SIMILARITY_THRESHOLD) {
                        return true;
                    }
                }
                return false;
            }
function shouldUseZoomLevel ( zoomLevel ) { var similarity = lastZoomLevel / zoomLevel ; // remove duplicates if ( zoomLevel === lastZoomLevel ) { return false ; } // keep anything that is within the similarity threshold if ( similarity < ZOOM_LEVEL_SIMILARITY_THRESHOLD ) { return true ; } // check if it's a preset if ( util . inArray ( zoomLevel , presets ) > - 1 ) { // keep presets if they are within a higher threshold if ( similarity < ZOOM_LEVEL_PRESETS_SIMILARITY_THRESHOLD ) { return true ; } } return false ; }
Return true if we should use this zoom level
@param   {number} zoomLevel The zoom level to consider
@returns {boolean}          True if we should keep this level
@private
Return true if we should use this zoom level