()
| 374 | } |
| 375 | |
| 376 | function undoRemove() { |
| 377 | let data = undoBuffer.pop() |
| 378 | if (!data) { |
| 379 | return |
| 380 | } |
| 381 | if (data.next == null) { |
| 382 | data.parent.appendChild(data.element) |
| 383 | } else { |
| 384 | data.parent.insertBefore(data.element, data.next) |
| 385 | } |
| 386 | if (data.doubleUndo) { |
| 387 | undoRemove() |
| 388 | } |
| 389 | if (undoBuffer.length == 0) { |
| 390 | undoButton.classList.add("displayNone") |
| 391 | } |
| 392 | updateInitialText() |
| 393 | } |
| 394 | |
| 395 | undoButton.addEventListener("click", () => { |
| 396 | undoRemove() |
no test coverage detected