diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-18 17:45:32 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-18 17:45:32 +0100 |
| commit | b9f6429b6cc741c5240c1fea8bbf4c6244e4e5d1 (patch) | |
| tree | 9b127e7e9386ff2b2bd6f4ea498a027490cf5586 /tools/mq_editor | |
| parent | 5df09ec975568a233e62d0be071fa9725d6b5aac (diff) | |
feat(mq_editor): add clear all partials button
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'tools/mq_editor')
| -rw-r--r-- | tools/mq_editor/app.js | 14 | ||||
| -rw-r--r-- | tools/mq_editor/index.html | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tools/mq_editor/app.js b/tools/mq_editor/app.js index 862ec6c..b0b578b 100644 --- a/tools/mq_editor/app.js +++ b/tools/mq_editor/app.js @@ -255,6 +255,7 @@ function runExtraction() { extractBtn.disabled = false; autoSpreadAllBtn.disabled = false; document.getElementById('newPartialBtn').disabled = false; + document.getElementById('clearAllBtn').disabled = false; undoStack.length = 0; redoStack.length = 0; _updateUndoRedoBtns(); }, 50); } @@ -290,7 +291,20 @@ function createNewPartial() { } } +function clearAllPartials() { + if (!extractedPartials || extractedPartials.length === 0) return; + pushUndo(); + extractedPartials = []; + editor.setPartials([]); + if (viewer) { + viewer.setPartials([]); + viewer.setKeepCount(0); + viewer.selectPartial(-1); + } +} + document.getElementById('newPartialBtn').addEventListener('click', createNewPartial); +document.getElementById('clearAllBtn').addEventListener('click', clearAllPartials); document.getElementById('undoBtn').addEventListener('click', undo); document.getElementById('redoBtn').addEventListener('click', redo); diff --git a/tools/mq_editor/index.html b/tools/mq_editor/index.html index 49a9869..6cf691f 100644 --- a/tools/mq_editor/index.html +++ b/tools/mq_editor/index.html @@ -285,6 +285,7 @@ <button id="playBtn" disabled>▶ Play</button> <button id="stopBtn" disabled>■ Stop</button> <button id="newPartialBtn" disabled>+ Partial</button> + <button id="clearAllBtn" disabled>✕ Clear All</button> <button id="undoBtn" disabled>↩ Undo</button> <button id="redoBtn" disabled>↪ Redo</button> |
