use ESC-key to end search mode in browse form [done]
Posted: Sun Apr 10, 2022 4:10 pm
To exit the search mode in browse form, one should manually click in the search field, delete the search term and press the Enter key.
With the suggested code, one can simply press the escape key.
Code is here (last else if branch) and on Github https://github.com/nuBuilder/nuBuilder-4.5/pull/21:
With the suggested code, one can simply press the escape key.
Code is here (last else if branch) and on Github https://github.com/nuBuilder/nuBuilder-4.5/pull/21:
Code: Select all
$(document).keydown(function(e) {
if (e.keyCode == 27) { //-- ESC
if (nuIsVisible('nuMessageDiv')) {
$('#nuMessageDiv').remove();
} else if (nuIsVisible('nuOptionsListBox')) {
$('#nuOptionsListBox').remove();
} else if ($('.ctxmenu').is(':visible')) {
nuContextMenuClose();
} else if (parent.$('#nuModal').length == 1) {
let ae = document.activeElement;
$(ae).blur();
$(ae).focus();
if (nuFormsUnsaved() == 0) nuClosePopup();
} else if (nuFormType() == 'browse') {
nuSearchAction("");
}
}