提交 68797abd 编写于 作者: I isidor

fix activity bar context menu

上级 281bfeb0
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册