dashboard: add / eventhandler for search

This commit is contained in:
Johannes Zellner
2024-04-09 15:28:44 +02:00
parent 470b0d6be7
commit f02157857c
2 changed files with 15 additions and 2 deletions

View File

@@ -340,7 +340,7 @@ angular.module('Application').controller('AppsController', ['$scope', '$translat
// setup all the dialog focus handling
['applinksAddModal', 'applinksEditModal'].forEach(function (id) {
$('#' + id).on('shown.bs.modal', function () {
$(this).find("[autofocus]:first").focus();
$(this).find('autofocus]:first').focus();
});
});
@@ -351,4 +351,17 @@ angular.module('Application').controller('AppsController', ['$scope', '$translat
});
$('.modal-backdrop').remove();
function keyboardHandler(event) {
if (event.key === '/') {
document.getElementById('appSearch').focus();
event.preventDefault();
}
}
document.addEventListener('keydown', keyboardHandler);
$scope.$on('$destroy', function () {
document.removeEventListener('keydown', keyboardHandler);
});
}]);