diff options
Diffstat (limited to 'app/assets/javascripts/line_comments/application.js.coffee')
-rw-r--r-- | app/assets/javascripts/line_comments/application.js.coffee | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/app/assets/javascripts/line_comments/application.js.coffee b/app/assets/javascripts/line_comments/application.js.coffee index ae65502800e..cf42dd67002 100644 --- a/app/assets/javascripts/line_comments/application.js.coffee +++ b/app/assets/javascripts/line_comments/application.js.coffee @@ -1,15 +1,27 @@ #= require mithril +#= require_directory ./observers #= require_directory ./components #= require_directory . $ -> + allNoteIds = [] + resolvedNoteIds = [] # Render all the buttons $('.discussion').each -> $this = $(this) $('.js-line-comment', $(this)).each -> + resolved = !!$(this).data('resolved') + allNoteIds.push $(this).data('id') + resolvedNoteIds.push $(this).data('id') if resolved + m.mount $(this).get(0), m(CommentButton, - discussion_id: $this.data('discussion-id') - note_id: $(this).data('id') + discussionId: $this.data('discussion-id') + noteId: $(this).data('id') resolved: !!$(this).data('resolved') ) + + m.mount $('.js-line-comments-all').get(0), m(AllLines, + noteIds: allNoteIds + resolvedNoteIds: resolvedNoteIds + ) |