fix: import getFileIcon from utils.js + close button re-bind after setBody
- vaulthome.js: getFileIcon was imported from viewer.js but lives in utils.js - backups.js: setBody() now re-binds close button handler after innerHTML replacement
This commit is contained in:
+10
-1
@@ -112,7 +112,16 @@ function createOverlay() {
|
||||
|
||||
function setBody(html) {
|
||||
const panel = document.getElementById('backup-viewer-panel');
|
||||
if (panel) panel.innerHTML = html;
|
||||
if (!panel) return;
|
||||
panel.innerHTML = html;
|
||||
// Re-bind close button after innerHTML replacement
|
||||
const closeBtn = panel.querySelector('.backup-close-btn');
|
||||
if (closeBtn) {
|
||||
closeBtn.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
close();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function close() {
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
*/
|
||||
|
||||
import { api } from './auth.js';
|
||||
import { el, safeCreateIcons, getFileIcon } from './viewer.js';
|
||||
import { el, safeCreateIcons } from './viewer.js';
|
||||
import { getFileIcon } from './utils.js';
|
||||
import { TabManager } from './ui.js';
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user