Pull together and rename Notes partials

This commit is contained in:
Riyad Preukschas 2012-12-02 23:14:56 +01:00
parent 6fc10fa256
commit c20af32ae4
7 changed files with 24 additions and 30 deletions

View file

@ -1,18 +1,15 @@
- unless @notes.blank?
var notesHtml = "#{escape_javascript(render 'notes/notes')}";
- new_note_ids = @notes.map(&:id)
- if loading_more_notes?
:plain
NoteList.appendMoreNotes(#{new_note_ids}, "#{escape_javascript(render 'notes/notes')}");
NoteList.appendMoreNotes(#{new_note_ids}, notesHtml);
- elsif loading_new_notes?
:plain
NoteList.replaceNewNotes(#{new_note_ids}, "#{escape_javascript(render 'notes/notes')}");
NoteList.replaceNewNotes(#{new_note_ids}, notesHtml);
- else
:plain
NoteList.setContent(#{new_note_ids}, "#{escape_javascript(render 'notes/notes')}");
NoteList.setContent(#{new_note_ids}, notesHtml);
- else
- if loading_more_notes?
:plain
NoteList.finishedLoadingMore();
NoteList.finishedLoadingMore();