VladislavNechepaev

Untitled

Oct 22nd, 2021
668
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function createSimplifiedDropdown(targetId, dataset, facsId = null, addId = false){
  2.   const nativeContainer = document.getElementById(targetId).parentNode
  3.   document.getElementById(targetId).style.display = "none"
  4.   const selector = document.createElement("select")
  5.   selector.id = facsId
  6.   dataset.forEach(optionName => {
  7.     const option = document.createElement("option")
  8.     option.innerHTML = optionName
  9.     option.value = optionName
  10.     if (addId) option.id = (facsId || "dropdown") + "_" + optionName
  11.     selector.appendChild(option)
  12.   })
  13.   nativeContainer.appendChild(selector)
  14.   return selector
  15. }
  16.  
  17. //=============================================
  18.  
  19. if (values.support_with_lunch) {
  20.           if (values.office === "Lviv_test") {
  21.             lunchTypeSelector.parentNode.hidden = true
  22.             lunchTypeSelector.value = null
  23.             lunchLviv.hidden = false
  24.             meidoShown = false
  25.             fsNative.meido.value = ""
  26.           } else {
  27.             lunchLviv.hidden = true
  28.             lunchTypeSelector.parentNode.hidden = false
  29.           }
  30.         } else {
  31.           lunchTypeSelector.parentNode.hidden = true
  32.           lunchTypeSelector.value = null
  33.           if (meidoActive) meidoMenu.hidden = true
  34.           meidoShown = false
  35.           lunchLviv.hidden = true
  36.           fsNative.meido.value = ""
  37.         }
  38.  
  39.         const customMenuOption = document.getElementById("lunch_type_Custom menu")
  40.         customMenuOption.hidden = true
  41.         if (meidoTimeCheck && values.access_week !== "Current week" && officeMeido[values.office] && hasMeidoId) customMenuOption.hidden = false
  42.          
  43.         meidoShown = lunchTypeSelector.value === "Custom menu"
  44.         meidoMenu.hidden = !meidoShown
RAW Paste Data