Bugfix: MouseEvent.which is not reliable

This commit is contained in:
djmaze 2021-03-10 09:43:31 +01:00
parent 56df186e8d
commit 5601e100d9
3 changed files with 3 additions and 4 deletions

View file

@ -48,7 +48,7 @@ export class AbstractSystemDropDownUserView extends AbstractViewRight {
}
accountClick(account, event) {
if (account && event && undefined !== event.which && 1 === event.which) {
if (account && 0 === event.button) {
AccountStore.accounts.loading(true);
setTimeout(() => AccountStore.accounts.loading(false), 1000);
}

View file

@ -435,8 +435,7 @@ class MessageViewMailBoxUserView extends AbstractViewRight {
let el = eqs(event, 'a');
if (el) {
return !(
!!event &&
3 !== event.which &&
0 === event.button &&
mailToHelper(
el.href,
Settings.capa(Capa.Composer) ? ComposePopupView : null

View file

@ -152,7 +152,7 @@
if (e && target) {
let evt = new Event(type, {bubbles:true,cancelable:true});
evt.button = 0;
evt.which = evt.buttons = 1;
evt.buttons = 1;
// copy event properties into new event
['altKey','ctrlKey','metaKey','shiftKey'].forEach(k => evt[k] = e[k]);
let src = e.touches ? e.touches[0] : e;