From eeee4f5a285e44e71553d9338039483c018c2af8 Mon Sep 17 00:00:00 2001 From: j Date: Mon, 11 Feb 2019 14:08:52 +0530 Subject: [PATCH] only delete own annotations --- static/js/annotation.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/static/js/annotation.js b/static/js/annotation.js index 13887c6..6df2090 100644 --- a/static/js/annotation.js +++ b/static/js/annotation.js @@ -73,9 +73,11 @@ oml.ui.annotation = function(annotation, $iframe) { borderBottom: '1px solid rgb(208, 208, 208)', }).bindEvent({ key_delete: function() { - that.triggerEvent('delete', { - id: annotation.id - }) + if (annotation.user == oml.user.id) { + that.triggerEvent('delete', { + id: annotation.id + }) + } } }).append($quote).append($notes); @@ -98,9 +100,11 @@ oml.ui.annotation = function(annotation, $iframe) { } } that.delete = function() { - that.triggerEvent('delete', { - id: annotation.id - }) + if (annotation.user == oml.user.id) { + that.triggerEvent('delete', { + id: annotation.id + }) + } } that.deselect = function() { that.removeClass('selected')