Skip to content

Commit

Permalink
Editor / Turn off hotkeys while editing
Browse files Browse the repository at this point in the history
Related to geonetwork#4897
  • Loading branch information
fxprunayre committed Aug 10, 2020
1 parent a36b556 commit 632b57e
Showing 1 changed file with 30 additions and 14 deletions.
44 changes: 30 additions & 14 deletions web-ui/src/main/resources/catalog/js/edit/EditorBoardController.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,57 +219,73 @@
combo: 'd',
description: $translate.instant('hotkeyDirectory'),
callback: function(event) {
$location.path('/directory');
if ($location.path().indexOf("/metadata/") !== 0) {
$location.path('/directory');
}
}
}).add({
combo: 'i',
description: $translate.instant('hotkeyImportRecord'),
callback: function(event) {
$location.path('/import');
if ($location.path().indexOf("/metadata/") !== 0) {
$location.path('/import');
}
}
}).add({
combo: 'r',
description: $translate.instant('hotkeyAccessManager'),
callback: function(event) {
$location.path('/accessManager');
if ($location.path().indexOf("/metadata/") !== 0) {
$location.path('/accessManager');
}
}
}).add({
combo: 'h',
description: $translate.instant('hotkeyEditorBoard'),
callback: function(event) {
$location.path('/board');
if ($location.path().indexOf("/metadata/") !== 0) {
$location.path('/board');
}
}
}).add({
combo: '+',
description: $translate.instant('hotkeyAddRecord'),
callback: function(event) {
$location.path('/create');
if ($location.path().indexOf("/metadata/") !== 0) {
$location.path('/create');
}
}
}).add({
combo: 't',
description: $translate.instant('hotkeyFocusToSearch'),
callback: function(event) {
event.preventDefault();
var anyField = $('#gn-any-field');
if (anyField) {
gnUtilityService.scrollTo();
$location.path('/board');
anyField.focus();
if ($location.path().indexOf("/metadata/") !== 0) {
event.preventDefault();
var anyField = $('#gn-any-field');
if (anyField) {
gnUtilityService.scrollTo();
$location.path('/board');
anyField.focus();
}
}
}
}).add({
combo: 'enter',
description: $translate.instant('hotkeySearchTheCatalog'),
allowIn: ['INPUT'],
callback: function() {
angular.element($('#gn-any-field'))
.scope().triggerSearch()
if ($location.path().indexOf("/metadata/") !== 0) {
angular.element($('#gn-any-field'))
.scope().triggerSearch()
}
}
}).add({
combo: 'b',
description: $translate.instant('hotkeyBatchEdit'),
callback: function(event) {
$location.path('/batchedit');
if ($location.path().indexOf("/metadata/") !== 0) {
$location.path('/batchedit');
}
}
});
}, 500);
Expand Down

0 comments on commit 632b57e

Please sign in to comment.