1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-19 10:54:16 +02:00

@gkatsev fixed chapters menu. Fixes #3062. closes #3163

This commit is contained in:
Gary Katsevman 2016-03-09 14:26:07 -05:00
parent 5a5b42f2a7
commit feb7e26211
4 changed files with 9 additions and 10 deletions

View File

@ -2,7 +2,7 @@ CHANGELOG
=========
## HEAD (Unreleased)
_(none)_
* @gkatsev fixed chapters menu. Fixes #3062 ([view](https://github.com/videojs/video.js/pull/3163))
--------------------

View File

@ -2,11 +2,6 @@
@extend .vjs-icon-chapters;
}
.vjs-chapters-button .vjs-menu {
left: -10em; // (Width of vjs-menu - width of vjs-control) / 2
width: 0;
}
.vjs-chapters-button .vjs-menu ul {
width: 24em;
}

View File

@ -90,11 +90,13 @@ class ChaptersButton extends TextTrackButton {
let menu = this.menu;
if (menu === undefined) {
menu = new Menu(this.player_);
menu.contentEl().appendChild(Dom.createEl('li', {
let title = Dom.createEl('li', {
className: 'vjs-menu-title',
innerHTML: toTitleCase(this.kind_),
tabIndex: -1
}));
});
menu.children_.unshift(title);
Dom.insertElFirst(title, menu.contentEl());
}
if (chaptersTrack && chaptersTrack.cues == null) {

View File

@ -70,11 +70,13 @@ class MenuButton extends ClickableComponent {
// Add a title list item to the top
if (this.options_.title) {
menu.contentEl().appendChild(Dom.createEl('li', {
let title = Dom.createEl('li', {
className: 'vjs-menu-title',
innerHTML: toTitleCase(this.options_.title),
tabIndex: -1
}));
});
menu.children_.unshift(title);
Dom.insertElFirst(title, menu.contentEl());
}
this.items = this['createItems']();