mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-22 16:32:59 +00:00
Add sidebar search and support for search bar middle clicking
This commit is contained in:
committed by
GitHub
parent
1a73444275
commit
68b0759637
16
docs/_static/custom.js
vendored
16
docs/_static/custom.js
vendored
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user