From 81e943625d9b74a806ef79ab5689943a6af07764 Mon Sep 17 00:00:00 2001 From: j Date: Sat, 9 Feb 2019 17:10:52 +0530 Subject: [PATCH] deselect annotation --- static/js/annotation.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/static/js/annotation.js b/static/js/annotation.js index 01b8582..40af8f0 100644 --- a/static/js/annotation.js +++ b/static/js/annotation.js @@ -6,9 +6,16 @@ oml.ui.annotation = function(annotation, $iframe) { .html(Ox.encodeHTMLEntities(annotation.text).replace(/\n/g, '
')) .on({ click: function(event) { - that.select() + var id + if (event.ctrlKey) { + that.deselect() + id = null + } else { + that.select() + id = annotation.id + } $iframe.postMessage('selectAnnotation', { - id: annotation.id + id: id }) } });