1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-02 09:11:54 +02:00

Fixed some styles and menu element buildling.

This commit is contained in:
Steve Heffernan 2013-05-01 15:31:44 -07:00
parent 4faa411ece
commit fb603745dc
3 changed files with 20 additions and 4 deletions

View File

@ -328,11 +328,11 @@ so you can upgrade to newer versions easier. You can remove all these styles by
.vjs-default-skin .vjs-volume-bar { .vjs-default-skin .vjs-volume-bar {
width: 5em; width: 5em;
height: 0.6em; height: 0.6em;
margin: 1em auto 0; margin: 1.1em auto 0;
} }
.vjs-default-skin .vjs-volume-menu-button .vjs-menu-content { .vjs-default-skin .vjs-volume-menu-button .vjs-menu-content {
height: 2.5em; height: 2.9em;
} }
.vjs-default-skin .vjs-volume-level { .vjs-default-skin .vjs-volume-level {
@ -352,7 +352,7 @@ so you can upgrade to newer versions easier. You can remove all these styles by
.vjs-default-skin .vjs-volume-handle:before { .vjs-default-skin .vjs-volume-handle:before {
font-size: 0.9em; font-size: 0.9em;
top: -0.3em; top: -0.2em;
left: -0.2em; left: -0.2em;
width: 1em; width: 1em;

1
src/js/controls.js vendored
View File

@ -68,6 +68,7 @@ vjs.ControlBar.prototype.options_ = {
'fullscreenToggle': {}, 'fullscreenToggle': {},
'volumeControl': {}, 'volumeControl': {},
'muteToggle': {} 'muteToggle': {}
// 'volumeMenuButton': {}
} }
}; };

View File

@ -21,9 +21,24 @@ vjs.Menu.prototype.addItem = function(component){
/** @inheritDoc */ /** @inheritDoc */
vjs.Menu.prototype.createEl = function(){ vjs.Menu.prototype.createEl = function(){
return vjs.Component.prototype.createEl.call(this, 'ul', { var contentElType = this.options().contentElType || 'ul';
this.contentEl_ = vjs.createEl(contentElType, {
className: 'vjs-menu-content'
});
var el = vjs.Component.prototype.createEl.call(this, 'div', {
append: this.contentEl_,
className: 'vjs-menu' className: 'vjs-menu'
}); });
el.appendChild(this.contentEl_);
// Prevent clicks from bubbling up. Needed for Menu Buttons,
// where a click on the parent is significant
vjs.on(el, 'click', function(event){
event.preventDefault();
event.stopImmediatePropagation();
});
return el;
}; };
/** /**