prevent the arrow from leaving the screen. popcorn-port
authorhamidouk
Fri, 25 Nov 2011 16:55:48 +0100
branchpopcorn-port
changeset 337 ee1d1e4fcf45
parent 336 8da13562cfea
child 338 3ff4499f79bb
prevent the arrow from leaving the screen.
src/js/widgets/arrowWidget.js
--- a/src/js/widgets/arrowWidget.js	Fri Nov 25 15:14:19 2011 +0100
+++ b/src/js/widgets/arrowWidget.js	Fri Nov 25 16:55:48 2011 +0100
@@ -40,6 +40,11 @@
     var totalWidth = this.selector.width();
     var correction = ((27 / 2) / totalWidth) * 100;
     var corrected_percents = percents - correction;
+
+    /* don't move out of the screen */
+    if (corrected_percents <= 0)
+      corrected_percents = 0;
+
     this.selector.children(".Ldt-arrowWidget").animate({"left" : corrected_percents + "%"});
 
     this._oldAnnotation = currentAnnotation;