From 838de5f034077637fc035c178f66ad471630147e Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 10 Jun 2016 11:26:54 +0200 Subject: [PATCH] allow to scroll with mouse wheel --- .../browser/parts/editor/tabsTitleControl.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts index d0057cf3d42..8a34087cf2e 100644 --- a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts @@ -66,6 +66,15 @@ export class TabsTitleControl extends TitleControl { 'class': 'tabs-container' }, (div) => { this.tabsContainer = div; + + // Support to scroll the tabs container with the mouse wheel + // if we detect that scrolling happens in Y-axis + div.on('wheel', (e: WheelEvent) => { + if (e.deltaY && !e.deltaX) { + DOM.EventHelper.stop(e); + this.tabsContainer.getHTMLElement().scrollLeft += e.deltaY; + } + }); }); // Group Actions @@ -188,7 +197,7 @@ export class TabsTitleControl extends TitleControl { tab.on(DOM.EventType.MOUSE_DOWN, (e: MouseEvent) => { DOM.EventHelper.stop(e); - if (!DOM.findParentWithClass(e.target || e.srcElement, 'monaco-action-bar', 'tab')) { + if (e.button === 0 /* Left Button */ && !DOM.findParentWithClass(e.target || e.srcElement, 'monaco-action-bar', 'tab')) { this.editorService.openEditor(editor, null, position).done(null, errors.onUnexpectedError); } }); -- GitLab