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:
parent
337cdc091e
commit
5e54caf04c
1 changed files with 5 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue