Add sidebar search and support for search bar middle clicking

This commit is contained in:
Myst(MysterialPy)
2022-03-09 12:26:12 +10:00
committed by GitHub
parent 1a73444275
commit 68b0759637
3 changed files with 44 additions and 2 deletions

View File

@@ -95,3 +95,19 @@ document.addEventListener('keydown', (event) => {
activeModal.close();
}
});
function searchBarClick(event, which) {
event.preventDefault();
if (event.button === 1 || event.buttons === 4) {
which.target = "_blank"; // Middle mouse button was clicked. Set our target to a new tab.
}
else if (event.button === 2) {
return // Right button was clicked... Don't do anything here.
}
else {
which.target = "_self"; // Revert to same window.
}
which.submit();
}