equal
deleted
inserted
replaced
50 if(this.draggingOngoing || this._disableUpdate) |
50 if(this.draggingOngoing || this._disableUpdate) |
51 return; |
51 return; |
52 |
52 |
53 var time = this._Popcorn.currentTime(); |
53 var time = this._Popcorn.currentTime(); |
54 |
54 |
55 var duration = this._serializer.getDuration() / 1000; |
55 var duration = this.getDuration() / 1000; |
56 var percents = time / duration; |
56 var percents = time / duration; |
57 |
57 |
58 /* we do these complicated calculations to center exactly |
58 /* we do these complicated calculations to center exactly |
59 the position Marker */ |
59 the position Marker */ |
60 |
60 |
90 |
90 |
91 var parentOffset = this.sliderBackground.parent().offset(); |
91 var parentOffset = this.sliderBackground.parent().offset(); |
92 var width = this.sliderBackground.width(); |
92 var width = this.sliderBackground.width(); |
93 var relX = event.pageX - parentOffset.left; |
93 var relX = event.pageX - parentOffset.left; |
94 |
94 |
95 var duration = this._serializer.getDuration() / 1000; |
95 var duration = this.getDuration() / 1000; |
96 var newTime = ((relX / width) * duration).toFixed(2); |
96 var newTime = ((relX / width) * duration).toFixed(2); |
97 |
97 |
98 this._Popcorn.currentTime(newTime); |
98 this._Popcorn.currentTime(newTime); |
99 }; |
99 }; |
100 |
100 |
103 IriSP.SliderWidget.prototype.foregroundClickHandler = function(event) { |
103 IriSP.SliderWidget.prototype.foregroundClickHandler = function(event) { |
104 var parentOffset = this.sliderForeground.parent().offset(); |
104 var parentOffset = this.sliderForeground.parent().offset(); |
105 var width = this.sliderBackground.width(); |
105 var width = this.sliderBackground.width(); |
106 var relX = event.pageX - parentOffset.left; |
106 var relX = event.pageX - parentOffset.left; |
107 |
107 |
108 var duration = this._serializer.getDuration() / 1000; |
108 var duration = this.getDuration() / 1000; |
109 var newTime = ((relX / width) * duration).toFixed(2); |
109 var newTime = ((relX / width) * duration).toFixed(2); |
110 |
110 |
111 this._Popcorn.currentTime(newTime); |
111 this._Popcorn.currentTime(newTime); |
112 }; |
112 }; |
113 |
113 |
131 |
131 |
132 /* handles when the mouse leaves the slider */ |
132 /* handles when the mouse leaves the slider */ |
133 IriSP.SliderWidget.prototype.mouseOutHandler = function(event) { |
133 IriSP.SliderWidget.prototype.mouseOutHandler = function(event) { |
134 |
134 |
135 this.timeOutId = window.setTimeout(IriSP.wrap(this, this.minimizeOnTimeout), |
135 this.timeOutId = window.setTimeout(IriSP.wrap(this, this.minimizeOnTimeout), |
136 IriSP.widgetsDefaults.SliderWidget.minimize_period); |
136 this.minimize_period); |
137 }; |
137 }; |
138 |
138 |
139 IriSP.SliderWidget.prototype.minimizeOnTimeout = function(event) { |
139 IriSP.SliderWidget.prototype.minimizeOnTimeout = function(event) { |
140 this.sliderBackground.animate({"height": "5px"}, 100); |
140 this.sliderBackground.animate({"height": "5px"}, 100); |
141 this.sliderForeground.animate({"height": "5px"}, 100); |
141 this.sliderForeground.animate({"height": "5px"}, 100); |
160 */ |
160 */ |
161 var parentOffset = this.sliderForeground.parent().offset(); |
161 var parentOffset = this.sliderForeground.parent().offset(); |
162 var width = this.sliderBackground.width(); |
162 var width = this.sliderBackground.width(); |
163 var relX = event.originalEvent.pageX - parentOffset.left; |
163 var relX = event.originalEvent.pageX - parentOffset.left; |
164 |
164 |
165 var duration = this._serializer.getDuration() / 1000; |
165 var duration = this.getDuration() / 1000; |
166 var newTime = ((relX / width) * duration).toFixed(2); |
166 var newTime = ((relX / width) * duration).toFixed(2); |
167 this._Popcorn.currentTime(newTime); |
167 this._Popcorn.currentTime(newTime); |
168 |
168 |
169 this.draggingOngoing = false; |
169 this.draggingOngoing = false; |
170 }; |
170 }; |