diff --git a/packages/vscode/src/client.ts b/packages/vscode/src/client.ts index fa31b7ea6..3266e6ed2 100644 --- a/packages/vscode/src/client.ts +++ b/packages/vscode/src/client.ts @@ -6,6 +6,7 @@ import "./fill/windowsService"; import "./fill/environmentService"; import "./fill/vscodeTextmate"; import "./fill/codeEditor"; +import "./fill/mouseEvent"; import { PasteAction } from "./fill/paste"; import "./fill/dom"; import "./vscode.scss"; diff --git a/packages/vscode/src/fill/mouseEvent.ts b/packages/vscode/src/fill/mouseEvent.ts new file mode 100644 index 000000000..bfef104da --- /dev/null +++ b/packages/vscode/src/fill/mouseEvent.ts @@ -0,0 +1,19 @@ +import * as mouse from "vs/base/browser/mouseEvent"; + +/** + * Fix the wheel event for Firefox. + */ +class StandardWheelEvent extends mouse.StandardWheelEvent { + + public constructor(event: mouse.IMouseWheelEvent | null) { + super( + event, + (-(event as any as MouseWheelEvent).deltaX || 0) / 3, // tslint:disable-line no-any + (-(event as any as MouseWheelEvent).deltaY || 0) / 3, // tslint:disable-line no-any + ); + } + +} + +const target = mouse as typeof mouse; +target.StandardWheelEvent = StandardWheelEvent; diff --git a/scripts/vscode.patch b/scripts/vscode.patch index 39360307b..51af9d26d 100644 --- a/scripts/vscode.patch +++ b/scripts/vscode.patch @@ -1,32 +1,3 @@ -diff --git a/src/vs/base/browser/mouseEvent.ts b/src/vs/base/browser/mouseEvent.ts -index 89ff65ec49..bc0cf2b08c 100644 ---- a/src/vs/base/browser/mouseEvent.ts -+++ b/src/vs/base/browser/mouseEvent.ts -@@ -147,12 +147,15 @@ export class StandardWheelEvent { - if (e) { - let e1 = e; - let e2 = e; -+ let e3 = e; - - // vertical delta scroll - if (typeof e1.wheelDeltaY !== 'undefined') { - this.deltaY = e1.wheelDeltaY / 120; - } else if (typeof e2.VERTICAL_AXIS !== 'undefined' && e2.axis === e2.VERTICAL_AXIS) { - this.deltaY = -e2.detail / 3; -+ } else if (typeof e3.deltaY !== "undefined") { -+ this.deltaY = -e3.deltaY / 3; - } - - // horizontal delta scroll -@@ -164,6 +167,8 @@ export class StandardWheelEvent { - } - } else if (typeof e2.HORIZONTAL_AXIS !== 'undefined' && e2.axis === e2.HORIZONTAL_AXIS) { - this.deltaX = -e.detail / 3; -+ } else if (typeof e3.deltaX !== "undefined") { -+ this.deltaX = -e3.deltaX / 3; - } - - // Assume a vertical scroll if nothing else worked diff --git a/src/vs/base/browser/ui/scrollbar/scrollableElement.ts b/src/vs/base/browser/ui/scrollbar/scrollableElement.ts index a6256deeba..69819e0f3a 100644 --- a/src/vs/base/browser/ui/scrollbar/scrollableElement.ts