Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var list = new Array();
- // insert comments, nest children
- function print_comments(child, parent){
- comment_count++;
- // create comment
- list[comment_count] = $comment.clone();
- 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);
- // if there are children
- if(child.children) {
- //list[comment_count].attr('has_children','yes').find('.comment-children').append('fuck')
- // for each child
- parent.append(list[comment_count]);
- jQuery.each(child.children, function(i, child){
- //alert(list[comment_count].find('.comment-children').width());
- print_comments(child, list[comment_count].find('.comment-children'));
- })
- }
- else {
- // append comment to the group
- parent.append(list[comment_count]);
- }
- }
- // for each top-level comment in this moment
- jQuery.each(window.comments[window.moments[vid][j * moment_interval].id], function(i,c){
- print_comments(c, $g)
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement