提交 1af680b8 编写于 作者: B Benjamin Pasero

title control to not do unneeded work

上级 96afb61c
......@@ -220,8 +220,8 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
const titleAreaControl = this.getTitleAreaControl(position);
const context = this.stacks.groupAt(position);
titleAreaControl.setContext(context);
if (!context) {
titleAreaControl.refresh(); // clear out the control if the context is no longer present
if (!context && titleAreaControl.hasContext()) {
titleAreaControl.refresh(); // clear out the control if the context is no longer present and there was a context
}
});
......
......@@ -45,6 +45,7 @@ export interface IToolbarActions {
export interface ITitleAreaControl {
setContext(group: IEditorGroup): void;
hasContext(): boolean;
allowDragging(element: HTMLElement): boolean;
setDragged(dragged: boolean): void;
create(parent: HTMLElement): void;
......@@ -174,6 +175,10 @@ export abstract class TitleControl implements ITitleAreaControl {
this.context = group;
}
public hasContext(): boolean {
return !!this.context;
}
public update(instant?: boolean): void {
if (instant) {
this.scheduler.cancel();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册