Guest User

buddypress activity stream - Read More and Load More

a guest
Jul 29th, 2014
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. // Activity "Read More" links
  2. jq('div.activity').on('click', '.activity-read-more a', function(event) {
  3. var target = jq(event.target);
  4. var link_id = target.parent().attr('id').split('-');
  5. var a_id = link_id[3];
  6. var type = link_id[0]; /* activity or acomment */
  7.  
  8. var inner_class = type == 'acomment' ? 'acomment-content' : 'activity-inner';
  9. var a_inner = jq('li#' + type + '-' + a_id + ' .' + inner_class + ':first' );
  10. jq(target).addClass('loading');
  11.  
  12. jq.post( ajaxurl, {
  13. action: 'get_single_activity_content',
  14. 'activity_id': a_id
  15. },
  16. function(response) {
  17. jq(a_inner).slideUp(300).html(response).slideDown(300).trigger('post-load');
  18. });
  19.  
  20. return false;
  21. });
Add Comment
Please, Sign In to add comment