fix activity bar context menu

This commit is contained in:
isidor
2017-10-17 16:44:42 +02:00
parent 281bfeb078
commit 68797abd31
2 changed files with 6 additions and 6 deletions
@@ -113,7 +113,7 @@ export class ActivitybarPart extends Part implements IActivityBarService {
const $result = $('.content').appendTo($el);
// Top Actionbar with action items for each viewlet action
this.compositeBar.create($('.viewlets').appendTo($result).getHTMLElement());
this.compositeBar.create($result.getHTMLElement());
// Top Actionbar with action items for each viewlet action
this.createGlobalActivityActionBar($('.global-activity').appendTo($result).getHTMLElement());
@@ -152,9 +152,9 @@ export class CompositeBar implements ICompositeBar {
}
}
public create(container: HTMLElement): void {
dom.addClass(container, 'composite-bar');
this.compositeSwitcherBar = new ActionBar(container, {
public create(parent: HTMLElement): void {
const actionBarDiv = parent.appendChild(dom.$('composite-bar'));
this.compositeSwitcherBar = new ActionBar(actionBarDiv, {
actionItemProvider: (action: Action) => action instanceof CompositeOverflowActivityAction ? this.compositeOverflowActionItem : this.compositeIdToActionItems[action.id],
orientation: this.options.orientation,
ariaLabel: nls.localize('activityBarAriaLabel', "Active View Switcher"),
@@ -163,13 +163,13 @@ export class CompositeBar implements ICompositeBar {
this.updateCompositeSwitcher();
// Contextmenu for composites
this.toDispose.push(dom.addDisposableListener(container, dom.EventType.CONTEXT_MENU, (e: MouseEvent) => {
this.toDispose.push(dom.addDisposableListener(parent, dom.EventType.CONTEXT_MENU, (e: MouseEvent) => {
dom.EventHelper.stop(e, true);
this._onDidContextMenu.fire(e);
}));
// Allow to drop at the end to move composites to the end
this.toDispose.push(dom.addDisposableListener(container, dom.EventType.DROP, (e: DragEvent) => {
this.toDispose.push(dom.addDisposableListener(parent, dom.EventType.DROP, (e: DragEvent) => {
const draggedCompositeId = CompositeActionItem.getDraggedCompositeId();
if (draggedCompositeId) {
dom.EventHelper.stop(e, true);