Update table-bindings.js

This commit is contained in:
2025-10-13 22:55:39 +08:00
committed by GitHub
parent 4a0969ea33
commit f9d5205c0c

View File

@@ -320,14 +320,13 @@ export function renderTables() {
}
const highlights = TableManager.getHighlights();
const fragment = document.createDocumentFragment();
const placeholder = document.getElementById('add-table-placeholder');
if (placeholder) {
placeholder.remove();
}
container.innerHTML = '';
tables.forEach((tableData, tableIndex) => {
const header = document.createElement('div');
header.style.display = 'flex';
@@ -349,7 +348,7 @@ export function renderTables() {
`;
header.appendChild(title);
header.appendChild(controls);
container.appendChild(header);
fragment.appendChild(header);
const tableWrapper = document.createElement('div');
tableWrapper.className = 'amily2-table-wrapper';
@@ -616,9 +615,12 @@ export function renderTables() {
});
}
tableWrapper.appendChild(tableElement);
container.appendChild(tableWrapper);
fragment.appendChild(tableWrapper);
});
container.innerHTML = '';
container.appendChild(fragment);
if (placeholder) {
container.appendChild(placeholder);
}