From 15739ac7cc50665087cf1723456bcf4d03e93ea1 Mon Sep 17 00:00:00 2001 From: rr- Date: Wed, 16 Sep 2015 07:43:18 +0200 Subject: [PATCH] Fixed adding ghost post notes after removing some --- public_html/js/Presenters/PostNotesPresenter.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public_html/js/Presenters/PostNotesPresenter.js b/public_html/js/Presenters/PostNotesPresenter.js index b19e191b..50f83baa 100644 --- a/public_html/js/Presenters/PostNotesPresenter.js +++ b/public_html/js/Presenters/PostNotesPresenter.js @@ -97,7 +97,10 @@ App.Presenters.PostNotesPresenter = function( promise.wait(api.delete('/notes/' + postNote.id)) .then(function() { hideForm(); - postNote.$element.remove(); + notes = jQuery.grep(notes, function(otherNote) { + return otherNote.id !== postNote.id; + }); + render(); }).fail(function(response) { window.alert(response.json && response.json.error || response); });