fixed slider bug where the slider could be dragged out of his parent div. popcorn-port
authorhamidouk
Thu, 24 Nov 2011 14:50:57 +0100
branchpopcorn-port
changeset 322 6fc87426ecd4
parent 321 21d840371c6b
child 323 3cb8b5017080
fixed slider bug where the slider could be dragged out of his parent div.
src/js/widgets/sliderWidget.js
--- a/src/js/widgets/sliderWidget.js	Thu Nov 24 12:40:54 2011 +0100
+++ b/src/js/widgets/sliderWidget.js	Thu Nov 24 14:50:57 2011 +0100
@@ -19,7 +19,9 @@
 
   this.positionMarker.draggable({axis: "x",
   start: IriSP.wrap(this, this.positionMarkerDraggingStartedHandler),
-  stop: IriSP.wrap(this, this.positionMarkerDraggedHandler)});
+  stop: IriSP.wrap(this, this.positionMarkerDraggedHandler),
+  containment: "parent"
+  });
 
   this.sliderBackground.click(function(event) { self.clickHandler.call(self, event); });
 
@@ -27,7 +29,7 @@
   this._Popcorn.listen("timeupdate", IriSP.wrap(this, this.sliderUpdater));
 };
 
-/* updates the slider as time passes */
+/* update the slider and the position marker as time passes */
 IriSP.SliderWidget.prototype.sliderUpdater = function() {
   if(this.draggingOngoing)
     return;