()
| 71 | |
| 72 | // Update Columns in DOM - Reset HTML, Filter Array, Update localStorage |
| 73 | function updateDOM() { |
| 74 | // Check localStorage once |
| 75 | if (!updatedOnLoad) { |
| 76 | getSavedColumns(); |
| 77 | } |
| 78 | // Backlog Column |
| 79 | backlogListEl.textContent = ''; |
| 80 | backlogListArray.forEach((backlogItem, index) => { |
| 81 | createItemEl(backlogListEl, 0, backlogItem, index); |
| 82 | }); |
| 83 | backlogListArray = filterArray(backlogListArray); |
| 84 | // Progress Column |
| 85 | progressListEl.textContent = ''; |
| 86 | progressListArray.forEach((progressItem, index) => { |
| 87 | createItemEl(progressListEl, 1, progressItem, index); |
| 88 | }); |
| 89 | progressListArray = filterArray(progressListArray); |
| 90 | // Complete Column |
| 91 | completeListEl.textContent = ''; |
| 92 | completeListArray.forEach((completeItem, index) => { |
| 93 | createItemEl(completeListEl, 2, completeItem, index); |
| 94 | }); |
| 95 | completeListArray = filterArray(completeListArray); |
| 96 | // On Hold Column |
| 97 | onHoldListEl.textContent = ''; |
| 98 | onHoldListArray.forEach((onHoldItem, index) => { |
| 99 | createItemEl(onHoldListEl, 3, onHoldItem, index); |
| 100 | }); |
| 101 | onHoldListArray = filterArray(onHoldListArray); |
| 102 | // Don't run more than once, Update Local Storage |
| 103 | updatedOnLoad = true; |
| 104 | updateSavedColumns(); |
| 105 | } |
| 106 | |
| 107 | // Update Item - Delete if necessary, or update Array value |
| 108 | function updateItem(id, column) { |
no test coverage detected