提交 f1f62df7 编写于 作者: S Sandeep Somavarapu

incorporate feedback

上级 6eb0792c
......@@ -236,7 +236,7 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor
this._register(this.viewsRegistry.onViewsRegistered(({ views, viewContainer }) => this.onDidRegisterViews(views, viewContainer)));
this._register(this.viewsRegistry.onViewsDeregistered(({ views, viewContainer }) => this.onDidDeregisterViews(views, viewContainer)));
this._register(this.viewsRegistry.onDidChangeContainer(({ views, from, to }) => { this.removeViews(from, views); this.addViews(to, views); this._onDidChangeContainer.fire({ views, from, to }); }));
this._register(this.viewsRegistry.onDidChangeContainer(({ views, from, to }) => this.moveViews(views, from, to)));
this._register(this.viewContainersRegistry.onDidRegister(({ viewContainer }) => this.onDidRegisterViewContainer(viewContainer)));
this._register(this.viewContainersRegistry.onDidDeregister(({ viewContainer }) => this.onDidDeregisterViewContainer(viewContainer)));
......@@ -405,19 +405,23 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor
const to = viewContainer;
if (from && to && from !== to) {
this.removeViews(from, views);
this.addViews(to, views);
this.moveViews(views, from, to);
}
}
const oldLocation = this.viewContainersRegistry.getViewContainerLocation(from)!;
const newLocation = this.viewContainersRegistry.getViewContainerLocation(to)!;
private moveViews(views: IViewDescriptor[], from: ViewContainer, to: ViewContainer): void {
this.removeViews(from, views);
this.addViews(to, views);
if (oldLocation !== newLocation) {
this._onDidChangeLocation.fire({ views, from: oldLocation, to: newLocation });
}
const oldLocation = this.viewContainersRegistry.getViewContainerLocation(from)!;
const newLocation = this.viewContainersRegistry.getViewContainerLocation(to)!;
this._onDidChangeContainer.fire({ views, from, to });
this.saveViewPositionsToCache();
if (oldLocation !== newLocation) {
this._onDidChangeLocation.fire({ views, from: oldLocation, to: newLocation });
}
this._onDidChangeContainer.fire({ views, from, to });
this.saveViewPositionsToCache();
}
private registerViewContainerForSingleView(sourceView: IViewDescriptor, location: ViewContainerLocation): ViewContainer {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册