mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
client/views: fix middle click prevention on buttons for modern browsers
Browsers no longer fire the primary 'click' event for middle clicks. Old way kept for compatibility as it doesn't hurt anything. All browsers that support auxclick also have standardized MouseEvent.button values.
This commit is contained in:
@ -571,6 +571,11 @@ document.addEventListener("click", (e) => {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
document.addEventListener("auxclick", (e) => {
|
||||
if (e.target.getAttribute("href") === "" && e.button === 1) {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
htmlToDom: htmlToDom,
|
||||
|
Reference in New Issue
Block a user