/dev/adei-asec

To get this branch, use:
bzr branch http://darksoft.org/webbzr/dev/adei-asec

« back to all changes in this revision

Viewing changes to js/window.js

  • Committer: Suren A. Chilingaryan
  • Date: 2011-01-26 02:48:39 UTC
  • mto: This revision was merged to the branch mainline in revision 212.
  • Revision ID: csa@dside.dyndns.org-20110126024839-nv6qp2ie9stmd2dn
Support of Appled devices by Toni Pirhonen

Show diffs side-by-side

added added

removed removed

Lines of Context:
391
391
    }
392
392
}
393
393
/**PinchZoom 
394
 
 * Zooming x and y -axis when using Safari webkit browser on a touchdevice.
 
394
 * Zooming x and y -axis when using Safari webkit browser on a touchdevice. So far twofinger gestures are only possible with Apples iPhone, iPad, iPod. Android devices don´t support that feature yet.
395
395
 */
396
396
WINDOW.prototype.PinchZoom = function(values) {
 
397
  var iphone = isiPhone();
 
398
  var ipad = isiPad();
397
399
 
398
 
  if(values.device == "iPhone")
 
400
  if(iphone)
399
401
  {
400
402
    var scale_min = 0.34;
401
403
    var scale_max = 3.5;
402
404
  }
403
 
  if(values.device == "iPad"){
 
405
  if(ipad){
404
406
     var scale_min = 0.26;
405
407
     var scale_max = 10;
406
408
  }
407
 
  if(values.device != "undefined"){
 
409
  
 
410
  if(values.device) {
408
411
 
409
412
    if(values.scale > scale_max){ values.scale = scale_max;}
410
413
 
411
414
    if(values.startX > values.marginsLeft) {  
412
 
         var xmin = this.graph.xmin;
413
 
         var xmax = this.graph.xmax;
414
 
         var xzoomedmin =  values.startX;
 
415
 
415
416
         if(values.scale > 1){
416
 
            var xzoomedmax = adeiMathPreciseAdd(xzoomedmin,(xmax-xzoomedmin)/scale_max*(values.scale));
417
 
            this.SetCustomWindow(xzoomedmin,xzoomedmax);
 
417
            var xmin = values.x;
 
418
            var xmax = adeiMathPreciseAdd(xmin,(this.graph.xmax-xmin)/scale_max*values.scale);
 
419
            this.SetCustomWindow(xmin, xmax);
418
420
          }
419
421
          if(values.scale < 1){
420
422
            this.CenterZoomOut();