mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 02:02:35 -05:00
Vscode merge (#4582)
* Merge from vscode 37cb23d3dd4f9433d56d4ba5ea3203580719a0bd * fix issues with merges * bump node version in azpipe * replace license headers * remove duplicate launch task * fix build errors * fix build errors * fix tslint issues * working through package and linux build issues * more work * wip * fix packaged builds * working through linux build errors * wip * wip * wip * fix mac and linux file limits * iterate linux pipeline * disable editor typing * revert series to parallel * remove optimize vscode from linux * fix linting issues * revert testing change * add work round for new node * readd packaging for extensions * fix issue with angular not resolving decorator dependencies
This commit is contained in:
@@ -16,25 +16,27 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IContextMenuDelegate } from 'vs/base/browser/contextmenu';
|
||||
import { addDisposableListener, EventType } from 'vs/base/browser/dom';
|
||||
import { addDisposableListener, EventType, $, removeNode } from 'vs/base/browser/dom';
|
||||
import { attachMenuStyler } from 'vs/platform/theme/common/styler';
|
||||
import { domEvent } from 'vs/base/browser/event';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
export class ContextMenuHandler {
|
||||
private element: HTMLElement | null;
|
||||
private elementDisposable: IDisposable;
|
||||
private menuContainerElement: HTMLElement | null;
|
||||
private focusToReturn: HTMLElement;
|
||||
private block: HTMLElement | null;
|
||||
|
||||
constructor(
|
||||
element: HTMLElement,
|
||||
private layoutService: ILayoutService,
|
||||
private contextViewService: IContextViewService,
|
||||
private telemetryService: ITelemetryService,
|
||||
private notificationService: INotificationService,
|
||||
private keybindingService: IKeybindingService,
|
||||
private themeService: IThemeService
|
||||
) {
|
||||
this.setContainer(element);
|
||||
this.setContainer(this.layoutService.container);
|
||||
}
|
||||
|
||||
setContainer(container: HTMLElement | null): void {
|
||||
@@ -73,12 +75,16 @@ export class ContextMenuHandler {
|
||||
container.className += ' ' + className;
|
||||
}
|
||||
|
||||
// Render invisible div to block mouse interaction in the rest of the UI
|
||||
if (this.layoutService.hasWorkbench) {
|
||||
this.block = container.appendChild($('.context-view-block'));
|
||||
}
|
||||
|
||||
const menuDisposables: IDisposable[] = [];
|
||||
|
||||
const actionRunner = delegate.actionRunner || new ActionRunner();
|
||||
actionRunner.onDidBeforeRun(this.onActionRun, this, menuDisposables);
|
||||
actionRunner.onDidRun(this.onDidActionRun, this, menuDisposables);
|
||||
|
||||
menu = new Menu(container, actions, {
|
||||
actionItemProvider: delegate.getActionItem,
|
||||
context: delegate.getActionsContext ? delegate.getActionsContext() : null,
|
||||
@@ -106,6 +112,11 @@ export class ContextMenuHandler {
|
||||
delegate.onHide(!!didCancel);
|
||||
}
|
||||
|
||||
if (this.block) {
|
||||
removeNode(this.block);
|
||||
this.block = null;
|
||||
}
|
||||
|
||||
if (this.focusToReturn) {
|
||||
this.focusToReturn.focus();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user