Fixed adding ghost post notes after removing some

This commit is contained in:
rr- 2015-09-16 07:43:18 +02:00
parent 0edbd9bf40
commit 15739ac7cc

View file

@ -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);
});