From cdda41a7034f52beac369471236c877994892d8c Mon Sep 17 00:00:00 2001 From: Gregor Kralik Date: Wed, 27 Jan 2016 13:41:26 +0100 Subject: [PATCH] add class .vjs-selected to the selected version's menu item --- lib/videojs-resolution-switcher.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/videojs-resolution-switcher.js b/lib/videojs-resolution-switcher.js index 187c654..4e54581 100644 --- a/lib/videojs-resolution-switcher.js +++ b/lib/videojs-resolution-switcher.js @@ -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'); }); };