function openEditModal(e) {
  console.log(inputFields);
  e.preventDefault();

  dmpModal.style.display = "block";

  currentEditDay = e.target.dataset.jsEditMenu;
  currentEditDayNumber = parseInt(
    currentEditDay.charAt(currentEditDay.length - 1)
  );
  currentDayDisplay = days[currentEditDayNumber - 1];

  dmpModalHeader.textContent = `${currentDayDisplay} Menu Items`;

  inputFields.forEach((item) => {
    if (item.dataset.jsInputOne) {
      item.value = dmpContent[currentEditDay]["main"];
    } else if (item.dataset.jsInputTwo) {
      item.value = dmpContent[currentEditDay]["side1"];
    } else if (item.dataset.jsInputThree) {
      item.value = dmpContent[currentEditDay]["side2"];
    } else if (item.dataset.jsInputFour) {
      item.value = dmpContent[currentEditDay]["other"];
    } else if (item.dataset.jsInputFive) {
      item.value = dmpContent[currentEditDay]["notes"];
    }
  });

  let dmpModalMain = document.querySelector("[data-js-input-one]");
  dmpModalMain.focus();
  dmpModalMain.setSelectionRange(0, 100);
}
// define function to open modal and populate existing data where applicable
define function to open modal and populate existing data where applicable
define function to open modal and populate existing data where applicable
function openEditModal(e) {
  console.log(inputFields);
  e.preventDefault();
  dmpModal.style.display = "block";
  currentEditDay = e.target.dataset.jsEditMenu;
  currentEditDayNumber = parseInt(
    currentEditDay.charAt(currentEditDay.length - 1)
  );
  currentDayDisplay = days[currentEditDayNumber - 1];
  dmpModalHeader.textContent = `${currentDayDisplay} Menu Items`;
  inputFields.forEach((item) => {
    if (item.dataset.jsInputOne) {
      item.value = dmpContent[currentEditDay]["main"];
    } else if (item.dataset.jsInputTwo) {
      item.value = dmpContent[currentEditDay]["side1"];
    } else if (item.dataset.jsInputThree) {
      item.value = dmpContent[currentEditDay]["side2"];
    } else if (item.dataset.jsInputFour) {
      item.value = dmpContent[currentEditDay]["other"];
    } else if (item.dataset.jsInputFive) {
      item.value = dmpContent[currentEditDay]["notes"];
    }
  });
  let dmpModalMain = document.querySelector("[data-js-input-one]");
  dmpModalMain.focus();
  dmpModalMain.setSelectionRange(0, 100);
}
function openEditModal ( e ) { console . log ( inputFields ) ; e . preventDefault ( ) ; dmpModal . style . display = "block" ; currentEditDay = e . target . dataset . jsEditMenu ; currentEditDayNumber = parseInt ( currentEditDay . charAt ( currentEditDay . length - 1 ) ) ; currentDayDisplay = days [ currentEditDayNumber - 1 ] ; dmpModalHeader . textContent = ` ${ currentDayDisplay } ` ; inputFields . forEach ( ( item ) => { if ( item . dataset . jsInputOne ) { item . value = dmpContent [ currentEditDay ] [ "main" ] ; } else if ( item . dataset . jsInputTwo ) { item . value = dmpContent [ currentEditDay ] [ "side1" ] ; } else if ( item . dataset . jsInputThree ) { item . value = dmpContent [ currentEditDay ] [ "side2" ] ; } else if ( item . dataset . jsInputFour ) { item . value = dmpContent [ currentEditDay ] [ "other" ] ; } else if ( item . dataset . jsInputFive ) { item . value = dmpContent [ currentEditDay ] [ "notes" ] ; } } ) ; let dmpModalMain = document . querySelector ( "[data-js-input-one]" ) ; dmpModalMain . focus ( ) ; dmpModalMain . setSelectionRange ( 0 , 100 ) ; }
define function to open modal and populate existing data where applicable
define function to open modal and populate existing data where applicable