diff --git a/modules/glmv.js b/modules/glmv.js index 61207af..d6d616f 100644 --- a/modules/glmv.js +++ b/modules/glmv.js @@ -182,7 +182,13 @@ onAnnotation = function(e) { if (deleteHotspot) { deleteHotspot = null enableViewer() + const anName = e.target.childNodes[0].innerText + let purgeAnnotation = new RegExp('(?<="annotationSets"[\\S\\s]*?)(^.*?' + anName + '.*\n)','gm') e.target.remove() + const editText = $('#wpTextbox1').val() + const newText = editText.replace(purgeAnnotation,'') + const finalText = newText.replace(/(,)(\n\s+])/gm,'$2') + $('#wpTextbox1').val(finalText) writeMetadata() readMetadata() return