summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-11-25 20:02:13 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-11-25 20:02:13 +0100
commit906aea4252c2ee6a33f7ba47388e3b290677b2df (patch)
tree07778dba6d26b9c4f05f583709f9cb630a378e2a /core
parent6b5460f7557861ed78edeac48fe2b95f6fdf2b05 (diff)
parentf1b0bf069693344d6bf9d3bf27d81b56cb67d890 (diff)
downloadnextcloud-server-906aea4252c2ee6a33f7ba47388e3b290677b2df.tar.gz
nextcloud-server-906aea4252c2ee6a33f7ba47388e3b290677b2df.zip
Merge pull request #19212 from owncloud/search-shortcut
Add Ctrl+F shortcut for the search bar
Diffstat (limited to 'core')
-rw-r--r--core/search/js/search.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/search/js/search.js b/core/search/js/search.js
index 4e83a070170..ef99cf7e961 100644
--- a/core/search/js/search.js
+++ b/core/search/js/search.js
@@ -343,6 +343,18 @@
}
});
+ $(document).keydown(function(event) {
+ if ((event.ctrlKey || event.metaKey) && // Ctrl or Command (OSX)
+ !event.shiftKey &&
+ event.keyCode === 70 && // F
+ self.hasFilter(getCurrentApp()) && // Search is enabled
+ !$searchBox.is(':focus') // if searchbox is already focused do nothing (fallback to browser default)
+ ) {
+ $searchBox.focus();
+ event.preventDefault();
+ }
+ });
+
$searchResults.on('click', 'tr.result', function (event) {
var $row = $(this);
var item = $row.data('result');