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

Function addFolderActionButton

public/js/folderManager.js:1622–1654  ·  view source on GitHub ↗
(rowEl, folderPath)

Source from the content-addressed store, hash-verified

1620}
1621
1622function addFolderActionButton(rowEl, folderPath) {
1623 if (!rowEl || !folderPath) return;
1624 if (rowEl.querySelector('.folder-kebab')) return; // avoid duplicates
1625
1626 const btn = document.createElement('button');
1627 btn.type = 'button';
1628 // share styling with file list kebab
1629 btn.className = 'folder-kebab btn-actions-ellipsis material-icons';
1630 btn.textContent = 'more_vert';
1631
1632 const label = t('folder_actions') || 'Folder actions';
1633 btn.title = label;
1634 btn.setAttribute('aria-label', label);
1635
1636 // only control visibility/layout here; let CSS handle colors/hover
1637 Object.assign(btn.style, {
1638 display: 'none',
1639 marginLeft: '4px',
1640 flexShrink: '0'
1641 });
1642
1643 btn.addEventListener('click', async (e) => {
1644 e.preventDefault();
1645 e.stopPropagation();
1646 const rect = btn.getBoundingClientRect();
1647 const x = rect.right;
1648 const y = rect.bottom;
1649 const opt = rowEl.querySelector('.folder-option');
1650 await openFolderActionsMenu(folderPath, opt, x, y);
1651 });
1652
1653 rowEl.appendChild(btn);
1654}
1655
1656/* ----------------------
1657 DOM builders & DnD

Callers 2

makeChildLiFunction · 0.85
loadFolderTreeFunction · 0.85

Calls 2

tFunction · 0.85
openFolderActionsMenuFunction · 0.85

Tested by

no test coverage detected