mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-817: Merge reset keyboard state on navigation and form submission.
This commit is contained in:
@@ -138,6 +138,12 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
|
||||
keyboard.reset();
|
||||
};
|
||||
|
||||
// Release all keys upon form submission (there may not be corresponding
|
||||
// keyup events for key presses involved in submitting a form)
|
||||
$document.on('submit', function formSubmitted() {
|
||||
keyboard.reset();
|
||||
});
|
||||
|
||||
/**
|
||||
* Checks whether the clipboard data has changed, firing a new
|
||||
* "guacClipboard" event if it has.
|
||||
@@ -188,6 +194,11 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
|
||||
$scope.fatalError = error;
|
||||
});
|
||||
|
||||
// Ensure new pages always start with clear keyboard state
|
||||
$scope.$on('$routeChangeStart', function routeChanging() {
|
||||
keyboard.reset();
|
||||
});
|
||||
|
||||
// Update title and CSS class upon navigation
|
||||
$scope.$on('$routeChangeSuccess', function(event, current, previous) {
|
||||
|
||||
|
Reference in New Issue
Block a user