Files
upload-platform/upload/frontend/table/set_status.js
T

10 lines
415 B
JavaScript

import { flattenFiles } from './render.js';
export function setStatus(path, html, state, elements) {
const file = flattenFiles(state.nodes).find((item) => item.path === path);
if (!file) return;
const cell = Array.from(elements.tableBodyEl.querySelectorAll('.tree-row.tree-file'))
.find((row) => row.dataset.path === file.path)
?.querySelector('td:nth-child(3)');
if (cell) cell.innerHTML = html;
}