mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
GUACAMOLE-724: Allow keyboard interaction with client notifications.
This commit is contained in:
@@ -407,6 +407,23 @@ angular.module('client').directive('guacClientNotification', [function guacClien
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* Prevents the default behavior of the given AngularJS event if a
|
||||
* notification is currently shown and the client is focused.
|
||||
*
|
||||
* @param {event} e
|
||||
* The AngularJS event to selectively prevent.
|
||||
*/
|
||||
var preventDefaultDuringNotification = function preventDefaultDuringNotification(e) {
|
||||
if ($scope.status && $scope.client.clientProperties.focused)
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
// Block internal handling of key events (by the client) if a
|
||||
// notification is visible
|
||||
$scope.$on('guacBeforeKeydown', preventDefaultDuringNotification);
|
||||
$scope.$on('guacBeforeKeyup', preventDefaultDuringNotification);
|
||||
|
||||
}];
|
||||
|
||||
return directive;
|
||||
|
@@ -163,9 +163,8 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
|
||||
// Broadcast keydown events
|
||||
keyboard.onkeydown = function onkeydown(keysym) {
|
||||
|
||||
// Do not handle key events if not logged in or if a notification is
|
||||
// shown
|
||||
if ($scope.applicationState !== ApplicationState.READY || guacNotification.getStatus())
|
||||
// Do not handle key events if not logged in
|
||||
if ($scope.applicationState !== ApplicationState.READY)
|
||||
return true;
|
||||
|
||||
// Warn of pending keydown
|
||||
@@ -184,7 +183,7 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
|
||||
|
||||
// Do not handle key events if not logged in or if a notification is
|
||||
// shown
|
||||
if ($scope.applicationState !== ApplicationState.READY || guacNotification.getStatus())
|
||||
if ($scope.applicationState !== ApplicationState.READY)
|
||||
return;
|
||||
|
||||
// Warn of pending keyup
|
||||
|
Reference in New Issue
Block a user