src/js/widgets/sliderWidget.js
branchpopcorn-port
changeset 731 e02f43299022
parent 488 ab73470647cb
child 739 d28b9acfc445
--- a/src/js/widgets/sliderWidget.js	Fri Jan 27 12:06:04 2012 +0100
+++ b/src/js/widgets/sliderWidget.js	Fri Jan 27 15:34:15 2012 +0100
@@ -61,10 +61,16 @@
   var positionMarker_width = this.positionMarker.width();
   var correction = (pixels_to_percents * positionMarker_width) / 2;
 
+  /* check that we don't leave the left side */
   var newPos = percent - correction;
   if (newPos <= 0)
     newPos = 0;
   
+  /* check that we don't leave the right side */
+  var outPos = percent + correction;
+  if (outPos > 100)
+    newPos = 100;
+  
 	this.sliderForeground.css("width", percent + "%");
 	this.positionMarker.css("left", newPos + "%");