diff options
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? |