提交 5799dec0 编写于 作者: S Sandeep Somavarapu

FIx to show outline view on toggle

上级 1efc4735
......@@ -31,6 +31,7 @@ import { Event, Emitter } from 'vs/base/common/event';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { localize } from 'vs/nls';
import { isUndefined } from 'vs/base/common/types';
export interface IViewOptions extends IPanelOptions {
id: string;
......@@ -301,7 +302,13 @@ export class ViewsViewlet extends PanelViewlet implements IViewsViewlet {
toggleViewVisibility(id: string, focus?: boolean): TPromise<void> {
let viewState = this.viewsStates.get(id);
if (!viewState) {
return TPromise.as(null);
const viewDescriptor = this.getViewDescriptorsFromRegistry().filter(v => v.id === id)[0];
if (viewDescriptor && viewDescriptor.hideByDefault) {
viewState = { collapsed: viewDescriptor.collapsed, order: viewDescriptor.order, isHidden: void 0, size: void 0 };
this.viewsStates.set(id, viewState);
} else {
return TPromise.as(null);
}
}
viewState.isHidden = !!this.getView(id);
......@@ -579,8 +586,8 @@ export class ViewsViewlet extends PanelViewlet implements IViewsViewlet {
.sort((a, b) => {
const viewStateA = this.viewsStates.get(a.id);
const viewStateB = this.viewsStates.get(b.id);
const orderA = viewStateA ? viewStateA.order : a.order;
const orderB = viewStateB ? viewStateB.order : b.order;
const orderA = viewStateA && !isUndefined(viewStateA.order) ? viewStateA.order : a.order;
const orderB = viewStateB && !isUndefined(viewStateB.order) ? viewStateB.order : b.order;
if (orderB === void 0 || orderB === null) {
return -1;
......
......@@ -15,7 +15,8 @@ const _outlineDesc = <IViewDescriptor>{
ctor: OutlinePanel,
location: ViewLocation.Explorer,
canToggleVisibility: true,
hideByDefault: true
hideByDefault: true,
order: 2
};
ViewsRegistry.registerViews([_outlineDesc]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册