* Load and render entries for a directory * @param {string} url - Directory URL
(url)
| 42 | * @param {string} url - Directory URL |
| 43 | */ |
| 44 | async load(url) { |
| 45 | if (this.isLoading) return; |
| 46 | this.isLoading = true; |
| 47 | this.currentUrl = url; |
| 48 | |
| 49 | try { |
| 50 | this.clear(); |
| 51 | |
| 52 | const entries = await this.options.getEntries(url); |
| 53 | this.entries = helpers.sortDir(entries, { |
| 54 | sortByName: true, |
| 55 | showHiddenFiles: true, |
| 56 | }); |
| 57 | |
| 58 | if (this.entries.length > VIRTUALIZATION_THRESHOLD) { |
| 59 | this.renderVirtualized(); |
| 60 | } else { |
| 61 | this.renderWithFragment(); |
| 62 | } |
| 63 | } finally { |
| 64 | this.isLoading = false; |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * Render using DocumentFragment for batch DOM updates (small folders) |
no test coverage detected