提交 b07f0075 编写于 作者: B Benjamin Pasero

labels - cleanup click handler

上级 83af15cc
......@@ -7,7 +7,7 @@ import 'vs/css!./iconlabel';
import * as dom from 'vs/base/browser/dom';
import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel';
import { IMatch } from 'vs/base/common/filters';
import { IDisposable, combinedDisposable, Disposable } from 'vs/base/common/lifecycle';
import { Disposable } from 'vs/base/common/lifecycle';
export interface IIconLabelCreationOptions {
supportHighlights?: boolean;
......@@ -116,12 +116,6 @@ export class IconLabel extends Disposable {
return this.domNode.element;
}
onClick(callback: (event: MouseEvent) => void): IDisposable {
return combinedDisposable([
dom.addDisposableListener(this.labelDescriptionContainer.element, dom.EventType.CLICK, (e: MouseEvent) => callback(e)),
]);
}
setLabel(label?: string, description?: string, options?: IIconLabelValueOptions): void {
const classes = ['monaco-icon-label'];
if (options) {
......
......@@ -68,8 +68,6 @@ export interface IResourceLabel extends IDisposable {
setEditor(editor: IEditorInput, options?: IResourceLabelOptions): void;
clear(): void;
onClick(callback: (event: MouseEvent) => void): IDisposable;
}
export class ResourceLabels extends Disposable {
......@@ -127,7 +125,6 @@ export class ResourceLabels extends Disposable {
setEditor: (editor: IEditorInput, options?: IResourceLabelOptions) => widget.setEditor(editor, options),
setFile: (resource: uri, options?: IFileLabelOptions) => widget.setFile(resource, options),
clear: () => widget.clear(),
onClick: (callback: (event: MouseEvent) => void) => widget.onClick(callback),
dispose: () => this.disposeWidget(widget)
};
......
......@@ -41,7 +41,7 @@ export class NoTabsTitleControl extends TitleControl {
// Editor Label
this.editorLabel = this._register(this.instantiationService.createInstance(ResourceLabel, labelContainer, void 0)).element;
this._register(this.editorLabel.onClick(e => this.onTitleLabelClick(e)));
this._register(addDisposableListener(this.editorLabel.element, EventType.CLICK, e => this.onTitleLabelClick(e)));
// Breadcrumbs
this.createBreadcrumbsControl(labelContainer, { showFileIcons: false, showSymbolIcons: true, showDecorationColors: false, breadcrumbsBackground: () => Color.transparent });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册