function toggleNicknameDisplay() {
  const nameLabel = document.getElementById("comment-user");
  const nicknameField = document.getElementById("new-nickname");
  const nameValue = nameLabel.innerText;

  if(editing) {
    editing = false;
    nameLabel.style.display = "inline";
    nicknameField.style.display = "none";
    updateNickname();
  } else {
    editing = true;
    nicknameField.value = nameValue;
    nameLabel.style.display = "none";
    nicknameField.style.display = "inline";
  }
}
/* Toggles between nickname input and input display. */
Toggles between nickname input and input display.
Toggles between nickname input and input display .
function toggleNicknameDisplay() {
  const nameLabel = document.getElementById("comment-user");
  const nicknameField = document.getElementById("new-nickname");
  const nameValue = nameLabel.innerText;
  if(editing) {
    editing = false;
    nameLabel.style.display = "inline";
    nicknameField.style.display = "none";
    updateNickname();
  } else {
    editing = true;
    nicknameField.value = nameValue;
    nameLabel.style.display = "none";
    nicknameField.style.display = "inline";
  }
}
function toggleNicknameDisplay ( ) { const nameLabel = document . getElementById ( "comment-user" ) ; const nicknameField = document . getElementById ( "new-nickname" ) ; const nameValue = nameLabel . innerText ; if ( editing ) { editing = false ; nameLabel . style . display = "inline" ; nicknameField . style . display = "none" ; updateNickname ( ) ; } else { editing = true ; nicknameField . value = nameValue ; nameLabel . style . display = "none" ; nicknameField . style . display = "inline" ; } }
Toggles between nickname input and input display.
Toggles between nickname input and input display .