提交 f8e9f80d 编写于 作者: J Joao Moreno

expose scroll height

上级 ad569df8
...@@ -72,7 +72,7 @@ export class ListView<T> implements ISpliceable<T>, IDisposable { ...@@ -72,7 +72,7 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
private gesture: Gesture; private gesture: Gesture;
private rowsContainer: HTMLElement; private rowsContainer: HTMLElement;
private scrollableElement: ScrollableElement; private scrollableElement: ScrollableElement;
private scrollHeight: number; private _scrollHeight: number;
private didRequestScrollableElementUpdate: boolean = false; private didRequestScrollableElementUpdate: boolean = false;
private splicing = false; private splicing = false;
private dragAndDropScrollInterval: number; private dragAndDropScrollInterval: number;
...@@ -225,12 +225,12 @@ export class ListView<T> implements ISpliceable<T>, IDisposable { ...@@ -225,12 +225,12 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
} }
private updateScrollHeight(): void { private updateScrollHeight(): void {
this.scrollHeight = this.getContentHeight(); this._scrollHeight = this.getContentHeight();
this.rowsContainer.style.height = `${this.scrollHeight}px`; this.rowsContainer.style.height = `${this._scrollHeight}px`;
if (!this.didRequestScrollableElementUpdate) { if (!this.didRequestScrollableElementUpdate) {
DOM.scheduleAtNextAnimationFrame(() => { DOM.scheduleAtNextAnimationFrame(() => {
this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight }); this.scrollableElement.setScrollDimensions({ scrollHeight: this._scrollHeight });
this.didRequestScrollableElementUpdate = false; this.didRequestScrollableElementUpdate = false;
}); });
...@@ -390,6 +390,10 @@ export class ListView<T> implements ISpliceable<T>, IDisposable { ...@@ -390,6 +390,10 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
this.setScrollTop(scrollTop); this.setScrollTop(scrollTop);
} }
get scrollHeight(): number {
return this._scrollHeight;
}
// Events // Events
@memoize get onMouseClick(): Event<IListMouseEvent<T>> { return mapEvent(domEvent(this.domNode, 'click'), e => this.toMouseEvent(e)); } @memoize get onMouseClick(): Event<IListMouseEvent<T>> { return mapEvent(domEvent(this.domNode, 'click'), e => this.toMouseEvent(e)); }
......
...@@ -1054,6 +1054,10 @@ export class List<T> implements ISpliceable<T>, IDisposable { ...@@ -1054,6 +1054,10 @@ export class List<T> implements ISpliceable<T>, IDisposable {
this.view.setScrollTop(scrollTop); this.view.setScrollTop(scrollTop);
} }
get scrollHeight(): number {
return this.view.scrollHeight;
}
domFocus(): void { domFocus(): void {
this.view.domNode.focus(); this.view.domNode.focus();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册