From 599b33e55fb4c0aec78cd0895bcd13f3fed12ad2 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Mon, 30 Jul 2018 01:13:12 +1000 Subject: Click to play fix, poster fix, iOS controls fixes --- src/js/controls.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/js/controls.js') diff --git a/src/js/controls.js b/src/js/controls.js index da404441..27611b2f 100644 --- a/src/js/controls.js +++ b/src/js/controls.js @@ -378,7 +378,7 @@ const controls = { // Show the respective menu if (!isRadioButton && [32,39].includes(event.which)) { - controls.showMenuPanel.call(this, type); + controls.showMenuPanel.call(this, type, true); } else { let target; @@ -477,7 +477,7 @@ const controls = { break; } - controls.showMenuPanel.call(this, 'home'); + controls.showMenuPanel.call(this, 'home', event.type === 'keydown'); }, type, false, @@ -1118,7 +1118,7 @@ const controls = { }, // Show a panel in the menu - showMenuPanel(type = '') { + showMenuPanel(type = '', tabFocus = false) { const target = document.getElementById(`plyr-settings-${this.id}-${type}`); // Nothing to show, bail @@ -1170,7 +1170,7 @@ const controls = { // Focus the first item const firstItem = target.querySelector('[role^="menuitem"]'); - setFocus.call(this, firstItem, true); + setFocus.call(this, firstItem, tabFocus); }, // Build the default HTML @@ -1344,7 +1344,7 @@ const controls = { // Show menu on click on(menuItem, 'click', () => { - controls.showMenuPanel.call(this, type); + controls.showMenuPanel.call(this, type, false); }); const flex = createElement('span', null, i18n.get(type, this.config)); @@ -1406,12 +1406,12 @@ const controls = { event.stopPropagation(); // Show the respective menu - controls.showMenuPanel.call(this, 'home'); + controls.showMenuPanel.call(this, 'home', true); }, false); // Go back via button click on(backButton, 'click', () => { - controls.showMenuPanel.call(this, 'home'); + controls.showMenuPanel.call(this, 'home', false); }); // Add to pane -- cgit v1.2.3