window.addEventListener("load", function() {
  const aelTemplBtn=document.getElementsByClassName("row__info__btn");
  const elNewCB=document.getElementById("check-item-list__new-cb");
  const elTemplInp=document.getElementById("new__input-template");

  for(elBtn of aelTemplBtn)
    elBtn.addEventListener("click", function() {
      if ( elNewCB.checked ) elNewCB.click();
      elNewCB.click();
      elTemplInp.value = this.dataset.user;
    } );

  elNewCB.addEventListener("click", function() { elTemplInp.value = ""; } );
} );
