Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. var list = new Array();
  2. // insert comments, nest children
  3. function print_comments(child, parent){
  4. comment_count++;
  5. // create comment
  6. list[comment_count] = $comment.clone();
  7. list[comment_count].removeClass('top-comment').attr({'has_children':'no', 'id' : child.id, 'moment_id' : child.moment, 'comment_id' : child.id}).find('.comment-text').text(child.text).end().find('.comment-user').text(child.user);
  8. // if there are children
  9. if(child.children) {
  10. //list[comment_count].attr('has_children','yes').find('.comment-children').append('fuck')
  11. // for each child
  12. parent.append(list[comment_count]);
  13. jQuery.each(child.children, function(i, child){
  14. //alert(list[comment_count].find('.comment-children').width());
  15. print_comments(child, list[comment_count].find('.comment-children'));
  16. })
  17. }
  18. else {
  19. // append comment to the group
  20. parent.append(list[comment_count]);
  21. }
  22. }
  23. // for each top-level comment in this moment
  24. jQuery.each(window.comments[window.moments[vid][j * moment_interval].id], function(i,c){
  25. print_comments(c, $g)
  26. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement