Merge pull request #19212 from owncloud/search-shortcut

Add Ctrl+F shortcut for the search bar
This commit is contained in:
Thomas Müller 2015-11-25 20:02:13 +01:00
commit 906aea4252
1 changed files with 12 additions and 0 deletions

View File

@ -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');