1
0
mirror of https://git.tuxpa.in/a/code-server.git synced 2025-01-21 06:48:44 +00:00
code-server-2/packages/vscode/src/firefox.ts
2019-02-05 11:15:42 -06:00

21 lines
447 B
TypeScript

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;
}
},
});
}