()
| 269 | // keep your renderFileTable wrapper as-is |
| 270 | |
| 271 | export function bindFileListContextMenu() { |
| 272 | const container = document.getElementById('fileList'); |
| 273 | const menu = qMenu(); |
| 274 | if (!container || !menu) return; |
| 275 | |
| 276 | localizeMenu(); |
| 277 | |
| 278 | // Open on right click in the table |
| 279 | container.oncontextmenu = fileListContextMenuHandler; |
| 280 | |
| 281 | // Bind once |
| 282 | if (!__ctxBoundOnce) { |
| 283 | document.addEventListener('click', docClickClose); |
| 284 | document.addEventListener('keydown', docKeyClose); |
| 285 | menu.addEventListener('click', menuClickDelegate); // handles actions |
| 286 | __ctxBoundOnce = true; |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | // Rebind after table render (keeps your original behavior) |
| 291 | (function () { |
no test coverage detected