added some code to move the arrow (WIP).
--- a/src/js/widgets/segmentsWidget.js Mon Oct 24 12:42:45 2011 +0200
+++ b/src/js/widgets/segmentsWidget.js Mon Oct 24 12:43:13 2011 +0200
@@ -47,6 +47,21 @@
IriSP.jQuery("#" + id).click(function(_this, annotation) {
return function() { _this.clickHandler(annotation)};
}(this, annotation));
+
+ // also add an handler to move the arrow.
+ // FIXME: make it work - the arrow swings wildly atm.
+ var middle = IriSP.timeToPourcent(begin + (end - begin)/ 2, duration);
+ var arrow_div_width = IriSP.jQuery("#Ldt-Show-Arrow").width();
+
+ var real_middle = middle - (middle * (1 - this.width/arrow_div_width));
+ var conf = {start: begin, end: end,
+ onStart:
+ function(middle) {
+ return function() {
+ console.log(middle, real_middle);
+ IriSP.jQuery("#Ldt-Show-Arrow").animate({left: real_middle + '%'}, 1000); }}(middle)
+ };
+ this._Popcorn = this._Popcorn.code(conf);
}
};