From a353a59945d02eded39c74e1493ef29ffc35b68d Mon Sep 17 00:00:00 2001 From: Asher Date: Fri, 1 Feb 2019 12:38:42 -0600 Subject: [PATCH] Move wheel event change out of patch --- packages/vscode/src/fill/dom.ts | 11 +++++++++++ scripts/vscode.patch | 26 -------------------------- 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/packages/vscode/src/fill/dom.ts b/packages/vscode/src/fill/dom.ts index d176c41b..a97e5973 100644 --- a/packages/vscode/src/fill/dom.ts +++ b/packages/vscode/src/fill/dom.ts @@ -1,3 +1,6 @@ +import * as dom from "vs/base/browser/dom"; +import { IDisposable } from "vs/base/common/lifecycle"; + // Firefox has no implementation of toElement. if (!("toElement" in MouseEvent.prototype)) { Object.defineProperty(MouseEvent.prototype, "toElement", { @@ -17,3 +20,11 @@ if (!("toElement" in MouseEvent.prototype)) { }, }); } + +const _addDisposableListener = dom.addDisposableListener; +const addDisposableListener = (node: Element | Window | Document, type: string, handler: (event: any) => void, useCapture?: boolean): IDisposable => { + return _addDisposableListener(node, type === "mousewheel" ? "wheel" : type, handler, useCapture); +}; + +const target = dom as typeof dom; +target.addDisposableListener = addDisposableListener; diff --git a/scripts/vscode.patch b/scripts/vscode.patch index 51af9d26..82192aa7 100644 --- a/scripts/vscode.patch +++ b/scripts/vscode.patch @@ -1,16 +1,3 @@ -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 -+++ b/src/vs/base/browser/ui/scrollbar/scrollableElement.ts -@@ -311,7 +311,7 @@ export abstract class AbstractScrollableElement extends Widget { - this._onMouseWheel(new StandardWheelEvent(browserEvent)); - }; - -- this._mouseWheelToDispose.push(dom.addDisposableListener(this._listenOnDomNode, 'mousewheel', onMouseWheel)); -+ this._mouseWheelToDispose.push(dom.addDisposableListener(this._listenOnDomNode, 'wheel', onMouseWheel)); - } - } - diff --git a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts index 457818a975..ad45ffe58a 100644 --- a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts @@ -21,19 +8,6 @@ index 457818a975..ad45ffe58a 100644 } + +startup({ machineId: "1" }); -diff --git a/src/vs/editor/browser/controller/mouseHandler.ts b/src/vs/editor/browser/controller/mouseHandler.ts -index 1a8af35373..ae45e08aeb 100644 ---- a/src/vs/editor/browser/controller/mouseHandler.ts -+++ b/src/vs/editor/browser/controller/mouseHandler.ts -@@ -121,7 +121,7 @@ export class MouseHandler extends ViewEventHandler { - e.stopPropagation(); - } - }; -- this._register(dom.addDisposableListener(this.viewHelper.viewDomNode, 'mousewheel', onMouseWheel, true)); -+ this._register(dom.addDisposableListener(this.viewHelper.viewDomNode, 'wheel', onMouseWheel, true)); - - this._context.addEventHandler(this); - } diff --git a/src/vs/editor/contrib/clipboard/clipboard.ts b/src/vs/editor/contrib/clipboard/clipboard.ts index 5e43f1b39e..7775e3b6da 100644 --- a/src/vs/editor/contrib/clipboard/clipboard.ts