docs/openjscad.js
function(e) {
    this.touch.cur = 'shifting';
    var factor = 5e-3;
    var delta = 0;

    if (this.touch.lastY && (e.gesture.direction == 'up' || e.gesture.direction == 'down')) {
      this.touch.shiftControl
          .removeClass('shift-horizontal')
          .addClass('shift-vertical')
          .css('top', e.gesture.center.pageY + 'px');
      delta = e.gesture.deltaY - this.touch.lastY;
      this.viewpointY -= factor * delta * this.viewpointZ;
      this.angleX += delta;
    }
    if (this.touch.lastX && (e.gesture.direction == 'left' || e.gesture.direction == 'right')) {
      this.touch.shiftControl
          .removeClass('shift-vertical')
          .addClass('shift-horizontal')
          .css('left', e.gesture.center.pageX + 'px');
      delta = e.gesture.deltaX - this.touch.lastX;
      this.viewpointX += factor * delta * this.viewpointZ;
      this.angleZ += delta;
    }
    if (delta)
      this.onDraw();
    this.touch.lastX = e.gesture.deltaX;
    this.touch.lastY = e.gesture.deltaY;
  }
function(e) {
    this.touch.cur = 'shifting';
    var factor = 5e-3;
    var delta = 0;

    if (this.touch.lastY && (e.gesture.direction == 'up' || e.gesture.direction == 'down')) {
      this.touch.shiftControl
          .removeClass('shift-horizontal')
          .addClass('shift-vertical')
          .css('top', e.gesture.center.pageY + 'px');
      delta = e.gesture.deltaY - this.touch.lastY;
      this.viewpointY -= factor * delta * this.viewpointZ;
      this.angleX += delta;
    }
    if (this.touch.lastX && (e.gesture.direction == 'left' || e.gesture.direction == 'right')) {
      this.touch.shiftControl
          .removeClass('shift-vertical')
          .addClass('shift-horizontal')
          .css('left', e.gesture.center.pageX + 'px');
      delta = e.gesture.deltaX - this.touch.lastX;
      this.viewpointX += factor * delta * this.viewpointZ;
      this.angleZ += delta;
    }
    if (delta)
      this.onDraw();
    this.touch.lastX = e.gesture.deltaX;
    this.touch.lastY = e.gesture.deltaY;
  }
function ( e ) { this . touch . cur = 'shifting' ; var factor = 5e-3 ; var delta = 0 ; if ( this . touch . lastY && ( e . gesture . direction == 'up' || e . gesture . direction == 'down' ) ) { this . touch . shiftControl . removeClass ( 'shift-horizontal' ) . addClass ( 'shift-vertical' ) . css ( 'top' , e . gesture . center . pageY + 'px' ) ; delta = e . gesture . deltaY - this . touch . lastY ; this . viewpointY -= factor * delta * this . viewpointZ ; this . angleX += delta ; } if ( this . touch . lastX && ( e . gesture . direction == 'left' || e . gesture . direction == 'right' ) ) { this . touch . shiftControl . removeClass ( 'shift-vertical' ) . addClass ( 'shift-horizontal' ) . css ( 'left' , e . gesture . center . pageX + 'px' ) ; delta = e . gesture . deltaX - this . touch . lastX ; this . viewpointX += factor * delta * this . viewpointZ ; this . angleZ += delta ; } if ( delta ) this . onDraw ( ) ; this . touch . lastX = e . gesture . deltaX ; this . touch . lastY = e . gesture . deltaY ; }
shift after 0.5s touch&hold
shift after 0 . 5s touch&hold