提交 501502c5 编写于 作者: R Rob Lourens

Add "showLoading" option to tree to allow trees to opt out of the loading...

Add "showLoading" option to tree to allow trees to opt out of the loading indicator, since setTimeout/clearTimeout has a large perf impact
上级 7a14a0d0
......@@ -687,6 +687,7 @@ export interface ITreeOptions extends ITreeStyles {
ariaLabel?: string;
keyboardSupport?: boolean;
preventRootFocus?: boolean;
showLoading?: boolean;
}
export interface ITreeStyler {
......
......@@ -92,6 +92,7 @@ export class Tree implements _.ITree {
options.alwaysFocused = options.alwaysFocused === true ? true : false;
options.useShadows = options.useShadows === false ? false : true;
options.paddingOnRow = options.paddingOnRow === false ? false : true;
options.showLoading = options.showLoading === false ? false : true;
this.context = new TreeContext(this, configuration, options);
this.model = new Model.TreeModel(this.context);
......
......@@ -867,7 +867,7 @@ export class TreeView extends HeightMap {
var item = <Model.Item>e.item;
var viewItem = this.items[item.id];
if (viewItem) {
if (viewItem && this.context.options.showLoading) {
viewItem.loadingTimer = setTimeout(() => {
viewItem.loadingTimer = 0;
viewItem.loading = true;
......
......@@ -554,7 +554,8 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
accessibilityProvider: this.instantiationService.createInstance(SearchAccessibilityProvider),
dnd
}, {
ariaLabel: nls.localize('treeAriaLabel', "Search Results")
ariaLabel: nls.localize('treeAriaLabel', "Search Results"),
showLoading: false
});
this.tree.setInput(this.viewModel.searchResult);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册