| 56 | |
| 57 | // Create DOM Elements for each list item |
| 58 | function createItemEl(columnEl, column, item, index) { |
| 59 | // List Item |
| 60 | const listEl = document.createElement('li'); |
| 61 | listEl.textContent = item; |
| 62 | listEl.id = index; |
| 63 | listEl.classList.add('drag-item'); |
| 64 | listEl.draggable = true; |
| 65 | listEl.setAttribute('onfocusout', `updateItem(${index}, ${column})`); |
| 66 | listEl.setAttribute('ondragstart', 'drag(event)'); |
| 67 | listEl.contentEditable = true; |
| 68 | // Append |
| 69 | columnEl.appendChild(listEl); |
| 70 | } |
| 71 | |
| 72 | // Update Columns in DOM - Reset HTML, Filter Array, Update localStorage |
| 73 | function updateDOM() { |