Skip to content

Commit 366a4b0

Browse files
committed
Fix flipbit#18 : Remove note from images.notes on deletion
1 parent 654dc89 commit 366a4b0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

js/jquery.annotate.js

+4
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@
382382

383383
// Add the delete button
384384
var del = $('<a class="image-annotate-edit-delete">Delete</a>');
385+
var _image = this.image;
385386
del.click(function() {
386387
var form = $('#image-annotate-edit-form form');
387388

@@ -396,6 +397,9 @@
396397
}
397398

398399
annotation.image.mode = 'view';
400+
var idx = _image.notes.findIndex(function(note) { return note === editable.note; });
401+
_image.notes.splice(idx, 1);
402+
399403
editable.destroy();
400404
annotation.destroy();
401405
});

0 commit comments

Comments
 (0)