Change behavior of keydown (#26677)

This commit is contained in:
John BOTELLA 2023-11-18 02:21:45 +01:00 committed by GitHub
parent 6227580bda
commit 2efd482e73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 2 deletions

View file

@ -491,6 +491,13 @@ if ($mode == 'other') {
print '</tr>';
*/
// Show search area in top menu
print '<tr class="oddeven"><td>' . $langs->trans("ShowSearchAreaInTopMenu") . '</td><td>';
print ajax_constantonoff("MAIN_USE_TOP_MENU_SEARCH_DROPDOWN", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
print '</td>';
print '</tr>';
// Show bugtrack link
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")), $langs->trans("ShowBugTrackLinkDesc"));

View file

@ -2336,7 +2336,7 @@ WebhookSetup = Webhook setup
Settings = Settings
WebhookSetupPage = Webhook setup page
ShowQuickAddLink=Show a button to quickly add an element in top right menu
ShowSearchAreaInTopMenu=Show the search area in the top menu
HashForPing=Hash used for ping
ReadOnlyMode=Is instance in "Read Only" mode
DEBUGBAR_USE_LOG_FILE=Use the <b>dolibarr.log</b> file to trap Logs

View file

@ -2981,10 +2981,14 @@ function top_menu_search()
// prevent submiting form on press ENTER
jQuery("#top-global-search-input").keydown(function (e) {
if (e.keyCode == 13) {
if (e.keyCode == 13 || e.keyCode == 40) {
var inputs = $(this).parents("form").eq(0).find(":button");
if (inputs[inputs.index(this) + 1] != null) {
inputs[inputs.index(this) + 1].focus();
if (e.keyCode == 13){
inputs[inputs.index(this) + 1].trigger("click");
}
}
e.preventDefault();
return false;