dist/crocodoc.viewer.js
function (val, parsedZoom) {
            // check if we landed on a named mode
            switch (parsedZoom) {
                case this.calculateZoomValue(Crocodoc.ZOOM_AUTO):
                    // if the value passed is a named zoom mode, use that, because
                    // fitheight and fitwidth can sometimes clash with auto (else use auto)
                    if (typeof val === 'string' &&
                        (val === Crocodoc.ZOOM_FIT_WIDTH || val === Crocodoc.ZOOM_FIT_HEIGHT))
                    {
                        return val;
                    }
                    return Crocodoc.ZOOM_AUTO;
                case this.calculateZoomValue(Crocodoc.ZOOM_FIT_WIDTH):
                    return Crocodoc.ZOOM_FIT_WIDTH;
                case this.calculateZoomValue(Crocodoc.ZOOM_FIT_HEIGHT):
                    return Crocodoc.ZOOM_FIT_HEIGHT;
                default:
                    return null;
            }
        }
function (val, parsedZoom) {
            // check if we landed on a named mode
            switch (parsedZoom) {
                case this.calculateZoomValue(Crocodoc.ZOOM_AUTO):
                    // if the value passed is a named zoom mode, use that, because
                    // fitheight and fitwidth can sometimes clash with auto (else use auto)
                    if (typeof val === 'string' &&
                        (val === Crocodoc.ZOOM_FIT_WIDTH || val === Crocodoc.ZOOM_FIT_HEIGHT))
                    {
                        return val;
                    }
                    return Crocodoc.ZOOM_AUTO;
                case this.calculateZoomValue(Crocodoc.ZOOM_FIT_WIDTH):
                    return Crocodoc.ZOOM_FIT_WIDTH;
                case this.calculateZoomValue(Crocodoc.ZOOM_FIT_HEIGHT):
                    return Crocodoc.ZOOM_FIT_HEIGHT;
                default:
                    return null;
            }
        }
function ( val , parsedZoom ) { // check if we landed on a named mode switch ( parsedZoom ) { case this . calculateZoomValue ( Crocodoc . ZOOM_AUTO ) : // if the value passed is a named zoom mode, use that, because // fitheight and fitwidth can sometimes clash with auto (else use auto) if ( typeof val === 'string' && ( val === Crocodoc . ZOOM_FIT_WIDTH || val === Crocodoc . ZOOM_FIT_HEIGHT ) ) { return val ; } return Crocodoc . ZOOM_AUTO ; case this . calculateZoomValue ( Crocodoc . ZOOM_FIT_WIDTH ) : return Crocodoc . ZOOM_FIT_WIDTH ; case this . calculateZoomValue ( Crocodoc . ZOOM_FIT_HEIGHT ) : return Crocodoc . ZOOM_FIT_HEIGHT ; default : return null ; } }
Calculates the new zoomMode given the input val and the parsed zoom value
@param   {float|string} val  The input zoom value
@param   {float} parsedZoom  The parsed zoom value
@returns {string|null}       The new zoom move
Calculates the new zoomMode given the input val and the parsed zoom value