equal
deleted
inserted
replaced
18 this.selector.append(templ); |
18 this.selector.append(templ); |
19 this._Popcorn.listen("IriSP.SegmentsWidget.segmentClick", IriSP.wrap(this, this.segmentClickHandler)); |
19 this._Popcorn.listen("IriSP.SegmentsWidget.segmentClick", IriSP.wrap(this, this.segmentClickHandler)); |
20 }; |
20 }; |
21 |
21 |
22 IriSP.ArrowWidget.prototype.segmentClickHandler = function(percents) { |
22 IriSP.ArrowWidget.prototype.segmentClickHandler = function(percents) { |
23 this.selector.children(".Ldt-arrowWidget").css("left", percents + "%"); |
23 // we need to apply a fix because the arrow has a certain length |
|
24 // it's half the length of the arrow (27 / 2). We need to convert |
|
25 // it in percents though. |
|
26 var totalWidth = this.selector.width(); |
|
27 var correction = ((27 / 2) / totalWidth) * 100; |
|
28 var corrected_percents = percents - correction; |
|
29 this.selector.children(".Ldt-arrowWidget").animate({"left" : corrected_percents + "%"}); |
24 } |
30 } |