793 } |
793 } |
794 }) |
794 }) |
795 .on("touch", function(e) { |
795 .on("touch", function(e) { |
796 startLevel = currentlevel; |
796 startLevel = currentlevel; |
797 }) |
797 }) |
798 .on("pinchin", function(e) { |
798 .on("pinchin pinchout", function(e) { |
799 var newlevel = Math.max(0, Math.min(zoomlevels.length - 1, startLevel + Math.round(Math.log(e.gesture.scale)*scaleStep))); |
799 var x = e.gesture.center.pageX - $(this).offset().left; |
|
800 if (x > 380) { |
|
801 return; |
|
802 } |
|
803 var newlevel = Math.max( |
|
804 0, |
|
805 Math.min( |
|
806 zoomlevels.length - 1, |
|
807 startLevel + Math.round(Math.log(e.gesture.scale)*scaleStep) * (x > 140 ? 1 : -1) |
|
808 ) |
|
809 ); |
|
810 //$("#konsole").text(e.gesture.scale + " => " + newlevel); |
800 if (newlevel !== currentlevel) { |
811 if (newlevel !== currentlevel) { |
801 currentlevel = newlevel; |
812 currentlevel = newlevel; |
802 localduration = zoomlevels[currentlevel]; |
813 localduration = zoomlevels[currentlevel]; |
803 localpos = Math.max(localduration / 2, Math.min(data.duration - localduration / 2, localpos)); |
814 localpos = Math.max(localduration / 2, Math.min(data.duration - localduration / 2, localpos)); |
804 throttledShowLocal(); |
815 throttledShowLocal(); |