project/src/main/webapp/shared.js
/** Add tag to user input box once it is chosen */
Add tag to user input box once it is chosen
Add tag to user input box once it is chosen
function addTagsToInput(clickedAdder, tagId) {
  $(tagId).on('itemAdded', function() {
    removeExtraInputs(tagId);
  });
  $(tagId).on('itemRemoved', function(event) {
    addTagBackToPool(event.item, tagId);
  });
  getTagsScriptWithCallback(function() {
    $(tagId).tagsinput('refresh');
    $(tagId).tagsinput('add', $(clickedAdder).next().text());
  });
}
function addTagsToInput ( clickedAdder , tagId ) { $ ( tagId ) . on ( 'itemAdded' , function ( ) { removeExtraInputs ( tagId ) ; } ) ; $ ( tagId ) . on ( 'itemRemoved' , function ( event ) { addTagBackToPool ( event . item , tagId ) ; } ) ; getTagsScriptWithCallback ( function ( ) { $ ( tagId ) . tagsinput ( 'refresh' ) ; $ ( tagId ) . tagsinput ( 'add' , $ ( clickedAdder ) . next ( ) . text ( ) ) ; } ) ; }
Add tag to user input box once it is chosen
Add tag to user input box once it is chosen