Skip to content

Commit

Permalink
fix(settings): Fixed issue with Settings not retrieving the proper su…
Browse files Browse the repository at this point in the history
…bmenu after selecting an option from it
  • Loading branch information
rafa8626 committed Sep 13, 2018
1 parent d214e12 commit 643b82f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/js/controls/settings.ts
Expand Up @@ -265,8 +265,10 @@ class Settings implements PlayerComponent {
this.menu.classList.remove('om-settings--sliding');
}, 100);
} else if (hasClass(target, 'om-settings__menu-content')) {
const current = target.parentElement.querySelector('.om-settings__menu-label')
.getAttribute('data-value').replace(/(.*?)\-\w+$/, '$1');
const fragments = target.parentElement.querySelector('.om-settings__menu-label')
.getAttribute('data-value').split('-');
fragments.pop();
const current = fragments.join('-');

if (typeof this.submenu[current] !== undefined) {
this.menu.classList.add('om-settings--sliding');
Expand Down

0 comments on commit 643b82f

Please sign in to comment.