本文整理汇总了TypeScript中vs/base/browser/ui/scrollbar/scrollableElement.ScrollableElement.setScrollDimensions方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ScrollableElement.setScrollDimensions方法的具体用法?TypeScript ScrollableElement.setScrollDimensions怎么用?TypeScript ScrollableElement.setScrollDimensions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vs/base/browser/ui/scrollbar/scrollableElement.ScrollableElement
的用法示例。
在下文中一共展示了ScrollableElement.setScrollDimensions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: splice
splice(start: number, deleteCount: number, elements: T[] = []): T[] {
const previousRenderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight);
each(previousRenderRange, i => this.removeItemFromDOM(this.items[i]));
const inserted = elements.map<IItem<T>>(element => ({
id: String(this.itemId++),
element,
size: this.delegate.getHeight(element),
templateId: this.delegate.getTemplateId(element),
row: null
}));
this.rangeMap.splice(start, deleteCount, ...inserted);
const deleted = this.items.splice(start, deleteCount, ...inserted);
const renderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight);
each(renderRange, i => this.insertItemInDOM(this.items[i], i));
const scrollHeight = this.getContentHeight();
this.rowsContainer.style.height = `${scrollHeight}px`;
this.scrollableElement.setScrollDimensions({ scrollHeight });
return deleted.map(i => i.element);
}
示例2: layout
layout(height?: number): void {
this.scrollableElement.setScrollDimensions({
height: height || DOM.getContentHeight(this._domNode)
});
}