Skip to content

Instantly share code, notes, and snippets.

@bmease
Created March 6, 2018 18:24
Show Gist options
  • Save bmease/05ee3ab50452ac789ed09f3151f3511b to your computer and use it in GitHub Desktop.
Save bmease/05ee3ab50452ac789ed09f3151f3511b to your computer and use it in GitHub Desktop.
function appendLists(el) {
const boardId = el.value
// skip boards with no lists
if (!lists[boardId]) { return }
// create a new ul
let ul = document.createElement('ul')
// append all the list li's to the new ul
lists[boardId].forEach(li => ul.appendChild(li))
// append the new ul to the boards li
el.closest('li').appendChild(ul)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment