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) {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user