js/playscreen.js
changeset 12 81a8bb1d872a
parent 11 9833f3e24105
child 14 3aa6b9963de0
equal deleted inserted replaced
11:9833f3e24105 12:81a8bb1d872a
   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();