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:
9
src/controls.js
vendored
9
src/controls.js
vendored
@ -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));
|
||||
},
|
||||
|
Reference in New Issue
Block a user