deselect annotation

This commit is contained in:
j 2019-02-09 17:10:52 +05:30
parent 46e679f2b9
commit 81e943625d

View file

@ -6,9 +6,16 @@ oml.ui.annotation = function(annotation, $iframe) {
.html(Ox.encodeHTMLEntities(annotation.text).replace(/\n/g, '<br/>')) .html(Ox.encodeHTMLEntities(annotation.text).replace(/\n/g, '<br/>'))
.on({ .on({
click: function(event) { click: function(event) {
var id
if (event.ctrlKey) {
that.deselect()
id = null
} else {
that.select() that.select()
id = annotation.id
}
$iframe.postMessage('selectAnnotation', { $iframe.postMessage('selectAnnotation', {
id: annotation.id id: id
}) })
} }
}); });