mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
feat: hotkey "/" to open ACP search
This commit is contained in:
@@ -70,7 +70,7 @@
|
||||
"logout": "Log out",
|
||||
"view-forum": "View Forum",
|
||||
|
||||
"search.placeholder": "Search for settings",
|
||||
"search.placeholder": "Press "/" to search for settings",
|
||||
"search.no-results": "No results...",
|
||||
"search.search-forum": "Search the forum for <strong></strong>",
|
||||
"search.keep-typing": "Type more to see results...",
|
||||
|
||||
@@ -90,6 +90,11 @@ define('admin/modules/search', ['mousetrap'], function (mousetrap) {
|
||||
return false;
|
||||
});
|
||||
|
||||
mousetrap.bind('/', function (ev) {
|
||||
input.select();
|
||||
ev.preventDefault();
|
||||
});
|
||||
|
||||
mousetrap(input[0]).bind(['up', 'down'], function (ev, key) {
|
||||
var next;
|
||||
if (key === 'up') {
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
<form role="search">
|
||||
<div id="acp-search" >
|
||||
<div class="dropdown">
|
||||
<input type="text" autofocus data-toggle="dropdown" class="form-control" placeholder="[[admin/menu:search.placeholder]]">
|
||||
<input type="text" data-toggle="dropdown" class="form-control" placeholder="[[admin/menu:search.placeholder]]">
|
||||
<ul class="dropdown-menu dropdown-menu-right state-start-typing" role="menu">
|
||||
<li role="presentation" class="no-results">
|
||||
<a>[[admin/menu:search.no-results]]</a>
|
||||
|
||||
Reference in New Issue
Block a user