(item, dir)
| 97 | |
| 98 | function injectInteraction() { |
| 99 | function onSwap(item, dir) { |
| 100 | container.remove(); |
| 101 | const curPos = ordered.findIndex((e) => e[0] === item); |
| 102 | const newPos = curPos + dir; |
| 103 | if (newPos < 0 || newPos > ordered.length - 1) return; |
| 104 | |
| 105 | [ordered[curPos], ordered[newPos]] = [ordered[newPos], ordered[curPos]]; |
| 106 | appendItems(); |
| 107 | } |
| 108 | |
| 109 | function onChangeStatus(item, status) { |
| 110 | container.remove(); |
no test coverage detected