Archived
1
0
This repository has been archived on 2024-09-09. You can view files and clone it, but cannot push or open issues or pull requests.
code-server/packages/vscode/src/firefox.ts

21 lines
447 B
TypeScript
Raw Normal View History

2019-01-08 01:46:19 +01:00
import "./firefox.scss";
if (!("toElement" in MouseEvent.prototype)) {
Object.defineProperty(MouseEvent.prototype, "toElement", {
get: function (): EventTarget | null {
// @ts-ignore
const event = this as MouseEvent;
switch (event.type) {
case "mouseup":
case "focusin":
case "mousenter":
case "mouseover":
case "dragenter":
return event.target;
default:
return event.relatedTarget;
}
},
});
}