MCPcopy Create free account
hub / github.com/error311/FileRise / renderRecycleBinNode

Function renderRecycleBinNode

public/js/folderManager.js:1846–1887  ·  view source on GitHub ↗
(hasItems = false)

Source from the content-addressed store, hash-verified

1844}
1845
1846function renderRecycleBinNode(hasItems = false) {
1847 const ul = document.getElementById('rootChildren');
1848 const container = document.getElementById('folderTreeContainer');
1849 if (!ul || !container) return;
1850
1851 const existing = document.getElementById(RECYCLE_BIN_ID);
1852 if (existing) existing.remove();
1853
1854 const li = document.createElement('li');
1855 li.id = RECYCLE_BIN_ID;
1856 li.className = 'folder-item recycle-bin-item';
1857 li.setAttribute('role', 'treeitem');
1858 li.setAttribute('aria-expanded', 'false');
1859
1860 const row = document.createElement('div');
1861 row.className = 'folder-row recycle-bin-row';
1862
1863 const spacer = document.createElement('span');
1864 spacer.className = 'folder-spacer';
1865 spacer.setAttribute('aria-hidden', 'true');
1866
1867 const opt = document.createElement('button');
1868 opt.type = 'button';
1869 opt.id = 'recycleBinBtn';
1870 opt.className = 'folder-option recycle-bin-option';
1871 opt.setAttribute('data-folder', 'recycle_bin');
1872 opt.setAttribute('aria-label', t('recycle_bin') || 'Recycle Bin');
1873 opt.setAttribute('tabindex', '0');
1874
1875 const icon = document.createElement('span');
1876 icon.className = 'folder-icon recycle-bin-icon';
1877 icon.innerHTML = recycleBinSVG(hasItems);
1878
1879 const label = document.createElement('span');
1880 label.className = 'folder-label recycle-bin-label';
1881 label.textContent = t('recycle_bin') || 'Recycle Bin';
1882
1883 opt.append(icon, label);
1884 row.append(spacer, opt);
1885 li.append(row);
1886 ul.appendChild(li);
1887}
1888
1889export function updateRecycleBinState(hasItems) {
1890 window.recycleBinHasItems = !!hasItems;

Callers 1

placeRecycleBinNodeFunction · 0.85

Calls 2

tFunction · 0.85
recycleBinSVGFunction · 0.85

Tested by

no test coverage detected