Change behavior of keydown (#26677)
This commit is contained in:
parent
6227580bda
commit
2efd482e73
3 changed files with 13 additions and 2 deletions
|
|
@ -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"));
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue