diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php
index bc4201aa766..a7f457fe9f4 100644
--- a/htdocs/admin/ihm.php
+++ b/htdocs/admin/ihm.php
@@ -491,6 +491,13 @@ if ($mode == 'other') {
print '';
*/
+
+ // Show search area in top menu
+ print '
| ' . $langs->trans("ShowSearchAreaInTopMenu") . ' | ';
+ print ajax_constantonoff("MAIN_USE_TOP_MENU_SEARCH_DROPDOWN", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
+ print ' | ';
+ print '
';
+
// Show bugtrack link
print '| ';
print $form->textwithpicto($langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")), $langs->trans("ShowBugTrackLinkDesc"));
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 8bfbff04e03..22de1d56036 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -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 dolibarr.log file to trap Logs
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 94c21e89e1b..835615b4097 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -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;
|