(item, dir)
| 119 | } |
| 120 | |
| 121 | function onSwap(item, dir) { |
| 122 | container.remove(); |
| 123 | const curPos = elem.findIndex((e) => e === item); |
| 124 | const newPos = curPos + dir; |
| 125 | if (newPos < 0 || newPos > elem.length - 1) return; |
| 126 | |
| 127 | [elem[curPos], elem[newPos]] = [elem[newPos], elem[curPos]]; |
| 128 | [list[curPos], list[newPos]] = [list[newPos], list[curPos]]; |
| 129 | appendItems(); |
| 130 | } |
| 131 | |
| 132 | function onChangeStatus(item, status) { |
| 133 | container.remove(); |
no test coverage detected