function renderListInNavbar(listId, newListName) {
  // Check if list already exists
  let listsdiv = document.getElementById("listing_div");
  let list = document.querySelector(`[data-list-id=${listId}]`);
  if (list) {
    setNavbarListName(listId, newListName);
    return;
  }

  // Create new list in navbar
  let listsContainer = document.getElementById("listing_div");

  let newList = document.createElement("div");
  newList.classList.add("each-list-div");
  newList.setAttribute("data-list-id", listId);
  newList.addEventListener("drop", () => {
    InitializationModule.watchListOrder();
    InitializationModule.saveDataHandler();
  });

  let newGrip = document.createElement("i");
  newGrip.classList.add("fas", "fa-grip-lines", "grip-list")

  let newListInput = document.createElement("div");
  newListInput.classList.add("each-list-input");
  newListInput.innerHTML = newListName;
  newListInput.title = `Switch to '${newListName}'`;
  newListInput.addEventListener("click", () => {
    InitializationModule.switchToList(listId);
  });

  let listDelete = document.createElement("div");
  listDelete.innerHTML = "<i class='far fa-trash-alt'></i>";
  listDelete.classList.add("each-list-delete");
  listDelete.title = "Delete list";
  listDelete.addEventListener("click", () => {
    let list = document.querySelector(`[data-list-id=${listId}]`);
    let listName = list.querySelector(".each-list-input").innerHTML;
    InitializationModule.deleteList(listId, listName);
  });

  newList.append(newGrip, newListInput, listDelete);
  listsContainer.append(newList);
}
/**
 * Renders the specified list into the navbar
 * @function renderListInNavbar
 * @param {string} listId Id of the specified list
 * @param {string} newListName Name of the specified list
 */
Renders the specified list into the navbar
@function renderListInNavbar
@param {string} listId Id of the specified list
@param {string} newListName Name of the specified list
Renders the specified list into the navbar @function renderListInNavbar @param { string } listId Id of the specified list @param { string } newListName Name of the specified list
function renderListInNavbar(listId, newListName) {
  let listsdiv = document.getElementById("listing_div");
  let list = document.querySelector(`[data-list-id=${listId}]`);
  if (list) {
    setNavbarListName(listId, newListName);
    return;
  }
  let listsContainer = document.getElementById("listing_div");
  let newList = document.createElement("div");
  newList.classList.add("each-list-div");
  newList.setAttribute("data-list-id", listId);
  newList.addEventListener("drop", () => {
    InitializationModule.watchListOrder();
    InitializationModule.saveDataHandler();
  });
  let newGrip = document.createElement("i");
  newGrip.classList.add("fas", "fa-grip-lines", "grip-list")
  let newListInput = document.createElement("div");
  newListInput.classList.add("each-list-input");
  newListInput.innerHTML = newListName;
  newListInput.title = `Switch to '${newListName}'`;
  newListInput.addEventListener("click", () => {
    InitializationModule.switchToList(listId);
  });
  let listDelete = document.createElement("div");
  listDelete.innerHTML = "<i class='far fa-trash-alt'></i>";
  listDelete.classList.add("each-list-delete");
  listDelete.title = "Delete list";
  listDelete.addEventListener("click", () => {
    let list = document.querySelector(`[data-list-id=${listId}]`);
    let listName = list.querySelector(".each-list-input").innerHTML;
    InitializationModule.deleteList(listId, listName);
  });
  newList.append(newGrip, newListInput, listDelete);
  listsContainer.append(newList);
}
function renderListInNavbar ( listId , newListName ) { let listsdiv = document . getElementById ( "listing_div" ) ; let list = document . querySelector ( ` ${ listId } ` ) ; if ( list ) { setNavbarListName ( listId , newListName ) ; return ; } let listsContainer = document . getElementById ( "listing_div" ) ; let newList = document . createElement ( "div" ) ; newList . classList . add ( "each-list-div" ) ; newList . setAttribute ( "data-list-id" , listId ) ; newList . addEventListener ( "drop" , ( ) => { InitializationModule . watchListOrder ( ) ; InitializationModule . saveDataHandler ( ) ; } ) ; let newGrip = document . createElement ( "i" ) ; newGrip . classList . add ( "fas" , "fa-grip-lines" , "grip-list" ) let newListInput = document . createElement ( "div" ) ; newListInput . classList . add ( "each-list-input" ) ; newListInput . innerHTML = newListName ; newListInput . title = ` ${ newListName } ` ; newListInput . addEventListener ( "click" , ( ) => { InitializationModule . switchToList ( listId ) ; } ) ; let listDelete = document . createElement ( "div" ) ; listDelete . innerHTML = "<i class='far fa-trash-alt'></i>" ; listDelete . classList . add ( "each-list-delete" ) ; listDelete . title = "Delete list" ; listDelete . addEventListener ( "click" , ( ) => { let list = document . querySelector ( ` ${ listId } ` ) ; let listName = list . querySelector ( ".each-list-input" ) . innerHTML ; InitializationModule . deleteList ( listId , listName ) ; } ) ; newList . append ( newGrip , newListInput , listDelete ) ; listsContainer . append ( newList ) ; }
Renders the specified list into the navbar
 @function renderListInNavbar
 @param {string} listId Id of the specified list
 @param {string} newListName Name of the specified list
Renders the specified list into the navbar @function renderListInNavbar @param { string } listId Id of the specified list @param { string } newListName Name of the specified list
// Check if list already exists // Create new list in navbar