2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 19:20:55 +00:00

Add callbacks for search panel opening and closing

This commit is contained in:
Oliver Walters
2022-03-28 10:18:49 +11:00
parent ffb89af9e5
commit 7d68b3209b
3 changed files with 33 additions and 2 deletions

View File

@ -4,5 +4,31 @@
*/
/* exported
closeSearchPanel,
openSearchPanel,
*/
function closeSearchPanel() {
// TODO
}
/*
* Callback when the search panel is opened.
* Ensure the panel is in a known state
*/
function openSearchPanel() {
var panel = $('#offcanvas-search');
// Ensure the 'no results found' element is visible
panel.find('#search-no-results').show();
// Finally, grab keyboard focus in the search bar
panel.find('#search-input').focus();
}