mirror of
https://github.com/kmoskwiak/videojs-resolution-switcher.git
synced 2025-10-03 09:49:21 +02:00
add class .vjs-selected to the selected version's menu item
This commit is contained in:
parent
e539a816b0
commit
cdda41a703
1 changed files with 7 additions and 0 deletions
|
@ -53,6 +53,8 @@
|
|||
if (options.initialySelected) {
|
||||
this.showAsLabel();
|
||||
this.selected(true);
|
||||
|
||||
this.addClass('vjs-selected');
|
||||
}
|
||||
},
|
||||
showAsLabel: function() {
|
||||
|
@ -67,6 +69,10 @@
|
|||
var currentTime = this.player_.currentTime();
|
||||
var isPaused = this.player_.paused();
|
||||
this.showAsLabel();
|
||||
|
||||
// add .current class
|
||||
this.addClass('vjs-selected');
|
||||
|
||||
// Hide bigPlayButton
|
||||
if(!isPaused){
|
||||
this.player_.bigPlayButton.hide();
|
||||
|
@ -123,6 +129,7 @@
|
|||
var onClickUnselectOthers = function(clickedItem) {
|
||||
menuItems.map(function(item) {
|
||||
item.selected(item === clickedItem);
|
||||
item.removeClass('vjs-selected');
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue