portfolio/src/main/webapp/comments.js
// creates a button that toggles reply form visibility
creates a button that toggles reply form visibility
creates a button that toggles reply form visibility
function createShowReplyFormButton(comment) {
  const showReplyFormButton = document.createElement('button');
  showReplyFormButton.innerText = 'Reply';
  showReplyFormButton.id = comment.key + '_button'; 
  showReplyFormButton.onclick = function() {
    toggleReplyField(comment.key);
  };
  return showReplyFormButton;
}
function createShowReplyFormButton ( comment ) { const showReplyFormButton = document . createElement ( 'button' ) ; showReplyFormButton . innerText = 'Reply' ; showReplyFormButton . id = comment . key + '_button' ; showReplyFormButton . onclick = function ( ) { toggleReplyField ( comment . key ) ; } ; return showReplyFormButton ; }
creates a button that toggles reply form visibility
creates a button that toggles reply form visibility
// this button must have unique id as I will change it's text // depending on form state