[buddypress-trac] [BuddyPress Trac] #5462: Heartbeat API to loaded activities and comments
buddypress-trac
noreply at wordpress.org
Fri Mar 14 15:51:39 UTC 2014
#5462: Heartbeat API to loaded activities and comments
-------------------------+-----------------------------
Reporter: mpa4hu | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Core | Version:
Severity: normal | Keywords:
-------------------------+-----------------------------
https://buddypress.trac.wordpress.org/ticket/5328
What about comments, I think instead of sending last ID, buddypress can
send parent activities that are loaded. Then check if any new activity
(with comments argument: stream) so get every activity on client side and
loop over them. if this is parent, just append it, else if it is a comment
append to its parent.
So how this works in my mind )
1) When loaded buddypress can save data attribute on `#activity-stream`
`<div id="activity-stream" data-activities-loaded="2,4,5,7"></div>`
2) send heartbeat with this data attribute
3) `if (bp_has_activities( bp_ajax_querystring( 'activity' ) .
'&display_comments=stream' ))`
4) when received:
if($(this).hasClass('activity_comment') {
append to its parent
} else {
append to #activity-stream
}
5) update `activities-loaded` attribute
(data-activities should also be updated when `load_more_activity` happens.
Maybe this adds a little overhead but definitely would improve user
experience.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5462>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list