Remove deleted annotation from sets
Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
@@ -182,7 +182,13 @@ onAnnotation = function(e) {
|
|||||||
if (deleteHotspot) {
|
if (deleteHotspot) {
|
||||||
deleteHotspot = null
|
deleteHotspot = null
|
||||||
enableViewer()
|
enableViewer()
|
||||||
|
const anName = e.target.childNodes[0].innerText
|
||||||
|
let purgeAnnotation = new RegExp('(?<="annotationSets"[\\S\\s]*?)(^.*?' + anName + '.*\n)','gm')
|
||||||
e.target.remove()
|
e.target.remove()
|
||||||
|
const editText = $('#wpTextbox1').val()
|
||||||
|
const newText = editText.replace(purgeAnnotation,'')
|
||||||
|
const finalText = newText.replace(/(,)(\n\s+])/gm,'$2')
|
||||||
|
$('#wpTextbox1').val(finalText)
|
||||||
writeMetadata()
|
writeMetadata()
|
||||||
readMetadata()
|
readMetadata()
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user