PostStream
Extends:
The PostStream
component displays an infinitely-scrollable wall of posts in
a discussion. Posts that have not loaded will be displayed as placeholders.
Attrs
discussion
stream
targetPost
onPositionChange
Member Summary
Public Members | ||
public |
|
|
public |
discussion: * |
|
public |
|
|
public |
stream: * |
Method Summary
Public Methods | ||
public |
calculatePosition(top: *) Work out which posts (by number) are currently visible in the viewport, and fire an event with the information. |
|
public |
flashItem($item: jQuery) 'Flash' the given post, drawing the user's attention to it. |
|
public |
getMarginTop(): Integer Get the distance from the top of the viewport to the point at which we would consider a post to be the first one visible. |
|
public |
loadPostsIfNeeded(top: Integer) Check if either extreme of the post stream is in the viewport, and if so, trigger loading the next/previous page. |
|
public |
oncreate(vnode: *) |
|
public |
oninit(vnode: *) |
|
public |
onremove(vnode: *) |
|
public |
onscroll(top: Integer) |
|
public |
onupdate(vnode: *) |
|
public |
scrollToIndex(index: Integer, animate: Boolean, reply: Boolean): jQuery.Deferred Scroll down to a certain post by index. |
|
public |
scrollToItem($item: jQuery, animate: Boolean, force: Boolean, reply: Boolean): jQuery.Deferred Scroll down to the given post. |
|
public |
scrollToNumber(number: Integer, animate: Boolean): jQuery.Deferred Scroll down to a certain post by number and 'flash' it. |
|
public |
Start scrolling, if appropriate, to a newly-targeted post. |
|
public |
updateScrubber(top: *) |
|
public |
view(): * |
Public Members
public calculatePositionTimeout: * source
public discussion: * source
public scrollListener: * source
public stream: * source
Public Methods
public calculatePosition(top: *) source
Work out which posts (by number) are currently visible in the viewport, and fire an event with the information.
Params:
Name | Type | Attribute | Description |
top | * |
|
public flashItem($item: jQuery) source
'Flash' the given post, drawing the user's attention to it.
Params:
Name | Type | Attribute | Description |
$item | jQuery |
public getMarginTop(): Integer source
Get the distance from the top of the viewport to the point at which we would consider a post to be the first one visible.
Return:
Integer |
public loadPostsIfNeeded(top: Integer) source
Check if either extreme of the post stream is in the viewport, and if so, trigger loading the next/previous page.
Params:
Name | Type | Attribute | Description |
top | Integer |
public oncreate(vnode: *) source
Params:
Name | Type | Attribute | Description |
vnode | * |
public oninit(vnode: *) source
Params:
Name | Type | Attribute | Description |
vnode | * |
public onremove(vnode: *) source
Params:
Name | Type | Attribute | Description |
vnode | * |
public onscroll(top: Integer) source
Params:
Name | Type | Attribute | Description |
top | Integer |
public onupdate(vnode: *) source
Params:
Name | Type | Attribute | Description |
vnode | * |
public scrollToIndex(index: Integer, animate: Boolean, reply: Boolean): jQuery.Deferred source
Scroll down to a certain post by index.
Return:
jQuery.Deferred |
public scrollToItem($item: jQuery, animate: Boolean, force: Boolean, reply: Boolean): jQuery.Deferred source
Scroll down to the given post.
Return:
jQuery.Deferred |
public scrollToNumber(number: Integer, animate: Boolean): jQuery.Deferred source
Scroll down to a certain post by number and 'flash' it.
Params:
Name | Type | Attribute | Description |
number | Integer | ||
animate | Boolean |
Return:
jQuery.Deferred |
public updateScrubber(top: *) source
Params:
Name | Type | Attribute | Description |
top | * |
|