function changeInviteElement(inviteKey){
    var inviteData;
    for (var i = 0; i < userArr.length; i++){
      if(inviteKey == userArr[i].uid){
        inviteData = userArr[i];
        break;
      }
    }

    var userUid = inviteData.uid;
    var inviteName = inviteData.name;
    var inviteUserName = inviteData.userName;
    var inviteShareCode = inviteData.shareCode;
    var liItemUpdate = document.getElementById("user" + inviteData.uid);
    liItemUpdate.innerHTML = inviteName;
    liItemUpdate.className = "gift";
    liItemUpdate.onclick = function (){
      var span = document.getElementsByClassName("close")[0];
      var inviteAdd = document.getElementById('userAccept');
      var inviteDelete = document.getElementById('userDelete');
      var inviteNameField = document.getElementById('userName');
      var inviteUserNameField = document.getElementById('userUName');
      var inviteShareCodeField = document.getElementById('userShareCode');

      if(inviteShareCode == undefined) {
        inviteShareCode = "This User Does Not Have A Share Code";
      }

      inviteNameField.innerHTML = inviteName;
      inviteUserNameField.innerHTML = "User Name: " + inviteUserName;
      inviteShareCodeField.innerHTML = "Share Code: " + inviteShareCode;

      inviteAdd.onclick = function(){
        addInvite(inviteData);
        modal.style.display = "none";
      };

      inviteDelete.onclick = function(){
        deleteInvite(userUid);
        modal.style.display = "none";
      };

      //show modal
      modal.style.display = "block";

      //close on close
      span.onclick = function() {
        modal.style.display = "none";
      };

      //close on click
      window.onclick = function(event) {
        if (event.target == modal) {
          modal.style.display = "none";
        }
      }
    };
  }
//with the proper invite's details and buttons.
with the proper invite's details and buttons.
with the proper invite ' s details and buttons .
function changeInviteElement(inviteKey){
    var inviteData;
    for (var i = 0; i < userArr.length; i++){
      if(inviteKey == userArr[i].uid){
        inviteData = userArr[i];
        break;
      }
    }
    var userUid = inviteData.uid;
    var inviteName = inviteData.name;
    var inviteUserName = inviteData.userName;
    var inviteShareCode = inviteData.shareCode;
    var liItemUpdate = document.getElementById("user" + inviteData.uid);
    liItemUpdate.innerHTML = inviteName;
    liItemUpdate.className = "gift";
    liItemUpdate.onclick = function (){
      var span = document.getElementsByClassName("close")[0];
      var inviteAdd = document.getElementById('userAccept');
      var inviteDelete = document.getElementById('userDelete');
      var inviteNameField = document.getElementById('userName');
      var inviteUserNameField = document.getElementById('userUName');
      var inviteShareCodeField = document.getElementById('userShareCode');
      if(inviteShareCode == undefined) {
        inviteShareCode = "This User Does Not Have A Share Code";
      }
      inviteNameField.innerHTML = inviteName;
      inviteUserNameField.innerHTML = "User Name: " + inviteUserName;
      inviteShareCodeField.innerHTML = "Share Code: " + inviteShareCode;
      inviteAdd.onclick = function(){
        addInvite(inviteData);
        modal.style.display = "none";
      };
      inviteDelete.onclick = function(){
        deleteInvite(userUid);
        modal.style.display = "none";
      };
      modal.style.display = "block";
      span.onclick = function() {
        modal.style.display = "none";
      };
      window.onclick = function(event) {
        if (event.target == modal) {
          modal.style.display = "none";
        }
      }
    };
  }
function changeInviteElement ( inviteKey ) { var inviteData ; for ( var i = 0 ; i < userArr . length ; i ++ ) { if ( inviteKey == userArr [ i ] . uid ) { inviteData = userArr [ i ] ; break ; } } var userUid = inviteData . uid ; var inviteName = inviteData . name ; var inviteUserName = inviteData . userName ; var inviteShareCode = inviteData . shareCode ; var liItemUpdate = document . getElementById ( "user" + inviteData . uid ) ; liItemUpdate . innerHTML = inviteName ; liItemUpdate . className = "gift" ; liItemUpdate . onclick = function ( ) { var span = document . getElementsByClassName ( "close" ) [ 0 ] ; var inviteAdd = document . getElementById ( 'userAccept' ) ; var inviteDelete = document . getElementById ( 'userDelete' ) ; var inviteNameField = document . getElementById ( 'userName' ) ; var inviteUserNameField = document . getElementById ( 'userUName' ) ; var inviteShareCodeField = document . getElementById ( 'userShareCode' ) ; if ( inviteShareCode == undefined ) { inviteShareCode = "This User Does Not Have A Share Code" ; } inviteNameField . innerHTML = inviteName ; inviteUserNameField . innerHTML = "User Name: " + inviteUserName ; inviteShareCodeField . innerHTML = "Share Code: " + inviteShareCode ; inviteAdd . onclick = function ( ) { addInvite ( inviteData ) ; modal . style . display = "none" ; } ; inviteDelete . onclick = function ( ) { deleteInvite ( userUid ) ; modal . style . display = "none" ; } ; modal . style . display = "block" ; span . onclick = function ( ) { modal . style . display = "none" ; } ; window . onclick = function ( event ) { if ( event . target == modal ) { modal . style . display = "none" ; } } } ; }
with the proper invite's details and buttons.
with the proper invite ' s details and buttons .
//show modal //close on close //close on click