mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-09-21 03:27:42 +00:00
Add sidebar search and support for search bar middle clicking
This commit is contained in:
Vendored
+16
@@ -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