src/UI/edit.js
function deleteAnnotation() {
  if (!overlay) { return; }

  let annotationId = overlay.getAttribute('data-target-id');
  let nodes = document.querySelectorAll(`[data-pdf-annotate-id="${annotationId}"]`);
  let svg = overlay.parentNode.querySelector('svg.annotationLayer');
  let { documentId } = getMetadata(svg);

  [...nodes].forEach((n) => {
    n.parentNode.removeChild(n);
  });
  
  PDFJSAnnotate.getStoreAdapter().deleteAnnotation(documentId, annotationId);

  destroyEditOverlay();
}
function deleteAnnotation() {
  if (!overlay) { return; }

  let annotationId = overlay.getAttribute('data-target-id');
  let nodes = document.querySelectorAll(`[data-pdf-annotate-id="${annotationId}"]`);
  let svg = overlay.parentNode.querySelector('svg.annotationLayer');
  let { documentId } = getMetadata(svg);

  [...nodes].forEach((n) => {
    n.parentNode.removeChild(n);
  });
  
  PDFJSAnnotate.getStoreAdapter().deleteAnnotation(documentId, annotationId);

  destroyEditOverlay();
}
function deleteAnnotation ( ) { if ( ! overlay ) { return ; } let annotationId = overlay . getAttribute ( 'data-target-id' ) ; let nodes = document . querySelectorAll ( ` ${ annotationId } ` ) ; let svg = overlay . parentNode . querySelector ( 'svg.annotationLayer' ) ; let { documentId } = getMetadata ( svg ) ; [ ... nodes ] . forEach ( ( n ) => { n . parentNode . removeChild ( n ) ; } ) ; PDFJSAnnotate . getStoreAdapter ( ) . deleteAnnotation ( documentId , annotationId ) ; destroyEditOverlay ( ) ; }
Delete currently selected annotation
Delete currently selected annotation