navigation.js: Retrieve focussed element more efficiently

This commit is contained in:
Florian Strohmaier 2022-05-12 15:22:44 +02:00
parent df788ac0ef
commit 2a6d66929c
1 changed files with 1 additions and 2 deletions

View File

@ -382,7 +382,6 @@
* @param {Object} e Event
*/
Navigation.prototype.hideConfigFlyout = function(e) {
console.log('hide config flyout');
$('#layout').removeClass('config-flyout-open');
if (e.target) {
delete $(e.target).closest('.container')[0].dataset.suspendAutorefresh;
@ -407,7 +406,7 @@
Navigation.prototype.onKeyDown = function(e) {
var _this = e.data.self;
if (e.code == 'Enter' && $(':focus').is('.flyout a')) {
if (e.key == 'Enter' && $(document.activeElement).is('.flyout a')) {
_this.hideConfigFlyout(e);
}
}