project/src/main/webapp/shared.js
/** Adds relevant tags to input box when corresponding option is clicked */
Adds relevant tags to input box when corresponding option is clicked
Adds relevant tags to input box when corresponding option is clicked
function populatePrefilled(elementId) {
  $('#prefilled-' + elementId).hide();
  getPrefilledInformation(elementId).then((prefilledInfo) => {
    for (const info of prefilledInfo) {
      const newTag = buildTagWithAdder(elementId, info);
      newTag.querySelector('.adder').addEventListener('click', function() {
        moveTagsFromPoolToInput(this, '#' + elementId);
      });
      $('#prefilled-' + elementId).append(newTag);
    }
  })
}
function populatePrefilled ( elementId ) { $ ( '#prefilled-' + elementId ) . hide ( ) ; getPrefilledInformation ( elementId ) . then ( ( prefilledInfo ) => { for ( const info of prefilledInfo ) { const newTag = buildTagWithAdder ( elementId , info ) ; newTag . querySelector ( '.adder' ) . addEventListener ( 'click' , function ( ) { moveTagsFromPoolToInput ( this , '#' + elementId ) ; } ) ; $ ( '#prefilled-' + elementId ) . append ( newTag ) ; } } ) }
Adds relevant tags to input box when corresponding option is clicked
Adds relevant tags to input box when corresponding option is clicked
// Build the option