src/a11y/initEventHandlers.js
function insertComment(documentId, annotationId, comment) {
  let list = document.querySelector(`pdf-annotate-screenreader-comment-list-${annotationId}`);
  let promise;

  if (!list) {
    promise = renderScreenReaderComments(documentId, annotationId, []).then(() => {
      list = document.querySelector(`pdf-annotate-screenreader-comment-list-${annotationId}`);
      return true;
    });
  } else {
    promise = Promise.resolve(true);
  }

  promise.then(() => {
    insertScreenReaderComment(comment);
  });
}
function insertComment(documentId, annotationId, comment) {
  let list = document.querySelector(`pdf-annotate-screenreader-comment-list-${annotationId}`);
  let promise;

  if (!list) {
    promise = renderScreenReaderComments(documentId, annotationId, []).then(() => {
      list = document.querySelector(`pdf-annotate-screenreader-comment-list-${annotationId}`);
      return true;
    });
  } else {
    promise = Promise.resolve(true);
  }

  promise.then(() => {
    insertScreenReaderComment(comment);
  });
}
function insertComment ( documentId , annotationId , comment ) { let list = document . querySelector ( ` ${ annotationId } ` ) ; let promise ; if ( ! list ) { promise = renderScreenReaderComments ( documentId , annotationId , [ ] ) . then ( ( ) => { list = document . querySelector ( ` ${ annotationId } ` ) ; return true ; } ) ; } else { promise = Promise . resolve ( true ) ; } promise . then ( ( ) => { insertScreenReaderComment ( comment ) ; } ) ; }
Insert a screen reader hint for a comment

@param {String} documentId The ID of the document
@param {String} annotationId The ID of tha assocated annotation
@param {Object} comment The comment to insert a hint for
Insert a screen reader hint for a comment