diff options
author | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-10-30 21:55:51 +0100 |
---|---|---|
committer | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-12-03 22:51:56 +0100 |
commit | bd60a4ed40ca52fd23e027de8f30e2f094eb6e5c (patch) | |
tree | dc64b73ebbcb66bcef325d89dca5b08f5fae24be /app/views/notes/index.js.haml | |
parent | ae067ee322e6702fb5ef0fd4f0cc4d4d5106cbde (diff) | |
download | gitlab-ce-bd60a4ed40ca52fd23e027de8f30e2f094eb6e5c.tar.gz |
Make notes JS know which notes are new in a request
Diffstat (limited to 'app/views/notes/index.js.haml')
-rw-r--r-- | app/views/notes/index.js.haml | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/views/notes/index.js.haml b/app/views/notes/index.js.haml index 99da619c649..cf46af6523b 100644 --- a/app/views/notes/index.js.haml +++ b/app/views/notes/index.js.haml @@ -1,15 +1,16 @@ - unless @notes.blank? + - new_note_ids = @notes.map(&:id) - if loading_more_notes? :plain - NoteList.appendMoreNotes(#{@notes.last.id}, "#{escape_javascript(render 'notes/notes')}"); + NoteList.appendMoreNotes(#{new_note_ids}, "#{escape_javascript(render 'notes/notes')}"); - elsif loading_new_notes? :plain - NoteList.replaceNewNotes("#{escape_javascript(render 'notes/notes')}"); + NoteList.replaceNewNotes(#{new_note_ids}, "#{escape_javascript(render 'notes/notes')}"); - else :plain - NoteList.setContent(#{@notes.first.id}, #{@notes.last.id}, "#{escape_javascript(render 'notes/notes')}"); + NoteList.setContent(#{new_note_ids}, "#{escape_javascript(render 'notes/notes')}"); - else - if loading_more_notes? |