Skip to content

Commit

Permalink
Focus active navigation item on popup. Fix #1049.
Browse files Browse the repository at this point in the history
  • Loading branch information
FelisCatus committed Apr 13, 2017
1 parent 118c358 commit 3854a01
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions omega-web/src/popup/js/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
handler();
}
});

$script.ready('om-profile-items', function() {
var activeNavLink = document.querySelector('.om-nav-item.om-active > a');
if (activeNavLink) activeNavLink.focus();
});
}

function tabbableElementsOnly(node) {
Expand Down
3 changes: 2 additions & 1 deletion omega-web/src/popup/js/profiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

var profileTemplate = document.getElementById('js-profile-tpl')
.cloneNode(true);
profileTemplate.classList.remove('om-profile-tpl');
profileTemplate.removeAttribute('id');

var iconForProfileType = {
'DirectProfile': 'glyphicon-transfer',
Expand Down Expand Up @@ -34,6 +34,7 @@
return;
}
addProfilesItems(state);
$script.done('om-profile-items');
updateOtherItems(state);
}

Expand Down

0 comments on commit 3854a01

Please sign in to comment.