equal
deleted
inserted
replaced
45 }); |
45 }); |
46 |
46 |
47 IriSP.jQuery("#" + id).click(function(_this, annotation) { |
47 IriSP.jQuery("#" + id).click(function(_this, annotation) { |
48 return function() { _this.clickHandler(annotation)}; |
48 return function() { _this.clickHandler(annotation)}; |
49 }(this, annotation)); |
49 }(this, annotation)); |
|
50 |
|
51 // also add an handler to move the arrow. |
|
52 // FIXME: make it work - the arrow swings wildly atm. |
|
53 var middle = IriSP.timeToPourcent(begin + (end - begin)/ 2, duration); |
|
54 var arrow_div_width = IriSP.jQuery("#Ldt-Show-Arrow").width(); |
|
55 |
|
56 var real_middle = middle - (middle * (1 - this.width/arrow_div_width)); |
|
57 var conf = {start: begin, end: end, |
|
58 onStart: |
|
59 function(middle) { |
|
60 return function() { |
|
61 console.log(middle, real_middle); |
|
62 IriSP.jQuery("#Ldt-Show-Arrow").animate({left: real_middle + '%'}, 1000); }}(middle) |
|
63 }; |
|
64 this._Popcorn = this._Popcorn.code(conf); |
50 } |
65 } |
51 }; |
66 }; |
52 |
67 |
53 IriSP.SegmentsWidget.prototype.clickHandler = function(annotation) { |
68 IriSP.SegmentsWidget.prototype.clickHandler = function(annotation) { |
54 var begin = Math.round((+ annotation.begin) / 1000); |
69 var begin = Math.round((+ annotation.begin) / 1000); |