diff --git a/views/stories/comments.jade b/views/stories/comments.jade index 2a2e5a8d55..3448323035 100644 --- a/views/stories/comments.jade +++ b/views/stories/comments.jade @@ -1,9 +1,10 @@ -h3.text-left +p.text-left div#comment-list.comment-list script(src="https://cdn.jsdelivr.net/ramda/0.10.0/ramda.min.js") script(src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.min.js") script. + var sentinel = 0; var commentDetails; R.forEach(function displayComments(comment) { console.log('this is the comment id', comment); @@ -22,42 +23,63 @@ h3.text-left commentDetails = data; var div = document.createElement('div'); $(div) - .html("" + - "
" + - "
" + - "
" + - "
" + - "" + + .html("

" + + "

" + + "
" + + "
" + + "
" + + "

" + + commentDetails.rank + + "

" + + "
" + "
" + "
" + - "
" + - "
" + - commentDetails.rank + + "
" + + "" + + "
" + + "
" + + "
" + + "
" + + commentDetails.body + + "
" + + "
" + + "
" + + "
" + + "
" + + "commented " + moment(commentDetails.commentedOn).fromNow() + " by " + + "@" + commentDetails.author.username + "" + + "
" + + "
" + + "
" + + "
" + + "
" + + "" + + "
" + "
" + "
" + "
" + - "
" + - "" + - "
" + - "
" + - "
" + - "
" + - commentDetails.body + - "
" + - "
" + - "
" + - "
" + - "commented " + moment(commentDetails.commentedOn).fromNow() + " by " + - "@" + commentDetails.author.username + "" + - "
" + - "
" + - "
" + - "
" + + "

" + "
") .appendTo($('#comment-list')); + + }, + complete: function() { + sentinel++; + console.log(sentinel, comments.length); + if (sentinel < comments.length) { + return; + } + $('.comment-a-comment').on('click', 'button', function() { + console.log('clicked'); + console.log($(this)); + }); } }) - }, comments); \ No newline at end of file + + }, comments); + + +