Replace switch in controls.updateSetting with condition

This commit is contained in:
Albin Larsson
2018-06-15 12:48:37 +02:00
parent c373ed72d7
commit 88735e3146

9
src/js/controls.js vendored
View File

@ -724,12 +724,9 @@ const controls = {
let value = null; let value = null;
let list = container; let list = container;
switch (setting) { if (setting === 'captions') {
case 'captions':
value = this.currentTrack; value = this.currentTrack;
break; } else {
default:
value = !is.empty(input) ? input : this[setting]; value = !is.empty(input) ? input : this[setting];
// Get default // Get default
@ -748,8 +745,6 @@ const controls = {
this.debug.warn(`Disabled value of '${value}' for ${setting}`); this.debug.warn(`Disabled value of '${value}' for ${setting}`);
return; return;
} }
break;
} }
// Get the list if we need to // Get the list if we need to