Add support for keyboard shortcut ALT + S to open search box
This commit is contained in:
parent
67ca02e1b3
commit
74d41c3d11
@ -8401,7 +8401,7 @@ class Form
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"><option></option></select>';
|
$out = '<select type="text" id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
|
||||||
|
|
||||||
$formattedarrayresult = array();
|
$formattedarrayresult = array();
|
||||||
|
|
||||||
|
|||||||
@ -2544,7 +2544,7 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
|
|||||||
*/
|
*/
|
||||||
function top_menu_quickadd()
|
function top_menu_quickadd()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$html = '';
|
$html = '';
|
||||||
|
|
||||||
@ -2846,7 +2846,6 @@ function top_menu_bookmark()
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
var openBookMarkDropDown = function() {
|
var openBookMarkDropDown = function() {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
jQuery("#topmenu-bookmark-dropdown").toggleClass("open");
|
jQuery("#topmenu-bookmark-dropdown").toggleClass("open");
|
||||||
@ -2991,13 +2990,16 @@ function top_menu_search()
|
|||||||
|
|
||||||
// Key map shortcut
|
// Key map shortcut
|
||||||
jQuery(document).keydown(function(e){
|
jQuery(document).keydown(function(e){
|
||||||
if( e.which === 70 && e.ctrlKey && e.shiftKey ){
|
if ( e.which === 70 && e.ctrlKey && e.shiftKey ) {
|
||||||
console.log(\'control + shift + f : trigger open global-search dropdown\');
|
console.log(\'control + shift + f : trigger open global-search dropdown\');
|
||||||
openGlobalSearchDropDown();
|
openGlobalSearchDropDown();
|
||||||
}
|
}
|
||||||
|
if ( e.which === 70 && e.alKey ) {
|
||||||
|
console.log(\'alt + f : trigger open global-search dropdown\');
|
||||||
|
openGlobalSearchDropDown();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
var openGlobalSearchDropDown = function() {
|
var openGlobalSearchDropDown = function() {
|
||||||
jQuery("#topmenu-global-search-dropdown").toggleClass("open");
|
jQuery("#topmenu-global-search-dropdown").toggleClass("open");
|
||||||
jQuery("#top-global-search-input").focus();
|
jQuery("#top-global-search-input").focus();
|
||||||
@ -3091,6 +3093,24 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_
|
|||||||
</script>' . "\n";
|
</script>' . "\n";
|
||||||
$searchform .= '</div>';
|
$searchform .= '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Key map shortcut
|
||||||
|
$searchform .= '<script>
|
||||||
|
jQuery(document).keydown(function(e){
|
||||||
|
if( e.which === 70 && e.ctrlKey && e.shiftKey ){
|
||||||
|
console.log(\'control + shift + f : trigger open global-search dropdown\');
|
||||||
|
openGlobalSearchDropDown();
|
||||||
|
}
|
||||||
|
if( (e.which === 83 || e.which === 115) && e.altKey ){
|
||||||
|
console.log(\'alt + s : trigger open global-search dropdown\');
|
||||||
|
openGlobalSearchDropDown();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var openGlobalSearchDropDown = function() {
|
||||||
|
jQuery("#searchselectcombo").select2(\'open\');
|
||||||
|
}
|
||||||
|
</script>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Left column
|
// Left column
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user