Fix audiobook export modal bindings and position for SPA routing
This commit is contained in:
parent
ee17ed97d1
commit
882e1ede55
2
static/dist/main.min.js
vendored
2
static/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
@ -6158,14 +6158,14 @@ function audiobookExportDialog() {
|
||||
if (typeof _abInitPauseUI === 'function') _abInitPauseUI();
|
||||
|
||||
const modal = document.getElementById('audiobook-export-modal');
|
||||
if (modal) modal.hidden = false;
|
||||
};
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
document.getElementById('ab-export-modal-close')?.addEventListener('click', () => document.getElementById('audiobook-export-modal').hidden = true);
|
||||
document.getElementById('ab-export-modal-cancel')?.addEventListener('click', () => document.getElementById('audiobook-export-modal').hidden = true);
|
||||
if (modal) {
|
||||
if (modal.parentElement !== document.body) {
|
||||
document.body.appendChild(modal);
|
||||
// Bind event listeners once when the modal is first moved
|
||||
document.getElementById('ab-export-modal-close')?.addEventListener('click', () => modal.hidden = true);
|
||||
document.getElementById('ab-export-modal-cancel')?.addEventListener('click', () => modal.hidden = true);
|
||||
document.getElementById('ab-export-modal-start')?.addEventListener('click', () => {
|
||||
document.getElementById('audiobook-export-modal').hidden = true;
|
||||
modal.hidden = true;
|
||||
const formatEl = document.querySelector('input[name="ab_export_format"]:checked');
|
||||
const format = formatEl ? formatEl.value : 'chapter';
|
||||
const folderEl = document.getElementById('ab-export-server-folder');
|
||||
@ -6174,4 +6174,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
const selectedChapterIndices = checkboxes.filter(cb => cb.checked).map(cb => parseInt(cb.value, 10));
|
||||
audiobookExport({ format, selectedChapterIndices, folder });
|
||||
});
|
||||
});
|
||||
}
|
||||
modal.hidden = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user