   Adds new note to list.
   ###
   addNote: (xhr, note, status) =>
-    @note_ids.push(note.id)
     @renderNote(note)
 
   ###

class Notes
  constructor: (notes_url, note_ids) ->
    @notes_url = notes_url
    @notes_url = gon.relative_url_root + @notes_url if gon.relative_url_root?

  Note: for rendering inline notes use renderDiscussionNote
  ###
  renderNote: (note) ->
    # render note if it not present in loaded list
    # or skip if rendered
    if @isNewNote(note)
      @note_ids.push(note.id)
      $('ul.main-notes-list').append(note.html)


  ###
  Check if note does not exists on page
  ###
  isNewNote: (note) ->
    $.inArray(note.id, @note_ids) == -1


  ###
  Render note in discussion area.
