1
0
mirror of https://github.com/videojs/video.js.git synced 2025-07-13 01:30:17 +02:00

Updated volume display to automically set itself.

This commit is contained in:
Steve Heffernan
2011-12-08 17:33:44 -08:00
parent d1fb95ecbf
commit 6945be3d6e
3 changed files with 22 additions and 5 deletions

9
src/controls.js vendored
View File

@ -323,6 +323,11 @@ _V_.Slider = _V_.Component.extend({
this.addEvent("mousedown", this.onMouseDown);
this.addEvent("focus", this.onFocus);
this.addEvent("blur", this.onBlur);
// Update Display
// Need to wait for styles to be loaded.
// TODO - replace setTimeout with stylesReady function.
setTimeout(this.proxy(this.update), 0);
},
createElement: function(type, attrs) {
@ -399,8 +404,6 @@ _V_.Slider = _V_.Component.extend({
boxW = box.offsetWidth,
handle = this.handle;
// _V_.log(box.offsetLeft, box.offsetLeft)
if (handle) {
var handleW = handle.el.offsetWidth;
@ -409,8 +412,6 @@ _V_.Slider = _V_.Component.extend({
boxW = boxW - handleW;
}
// _V_.log(event.pageX, boxX, boxW);
// Percent that the click is through the adjusted area
return Math.max(0, Math.min(1, (event.pageX - boxX) / boxW));
},