docs: function (val) {
              var zoomVal = parseFloat(val),
                  state = this.state,
                  zoomState = state.zoomState,
                  currentZoom = zoomState.zoom,
                  nextZoom = currentZoom;
  
              // number
              if (zoomVal) {
                  nextZoom = zoomVal;
              } else {
                  switch (val) {
                      case Crocodoc.ZOOM_FIT_WIDTH:
                          // falls through
                      case Crocodoc.ZOOM_FIT_HEIGHT:
                          // falls through
                      case Crocodoc.ZOOM_AUTO:
                          nextZoom = this.calculateZoomValue(val);
                          break;
  
                      case Crocodoc.ZOOM_IN:
                          // falls through
                      case Crocodoc.ZOOM_OUT:
                          nextZoom = this.calculateNextZoomLevel(val) || currentZoom;
                          break;
  
                      // bad mode or no value
                      default:
                          // if there hasn't been a zoom set yet
                          if (!currentZoom) {
                              //use default zoom
                              nextZoom = this.calculateZoomValue(this.config.zoom || Crocodoc.ZOOM_AUTO);
                          }
                          else if (zoomState.zoomMode) {
                              //adjust zoom
                              nextZoom = this.calculateZoomValue(zoomState.zoomMode);
                          } else {
                              nextZoom = currentZoom;
                          }
                          break;
                  }
              }
  
              return nextZoom;
          }