Commit 9997fec
committed
feat: refactor pagination and optimize displayWebsites function
- remove redundant nextPage/prevPage functions, add direct event listeners
- create unified updatePagination function for both search and websites tabs
- implement smart pagination distribution with max 10 pages constraint
- add sequential filling for datasets ≤100 items (10 per page)
- apply logarithmic scaling for large datasets (>500 items)
- add item numbering to websites list for better readability
- convert all createElement assignments from let to const
- clean up redundant variables and inline calculations
- fix early return guard clause in displayResults function
- optimize code structure for better maintainability and performance
- move all fixed DOM elements at script level1 parent 9ae011b commit 9997fec
2 files changed
Lines changed: 174 additions & 200 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
87 | | - | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | | - | |
| 91 | + | |
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| |||
0 commit comments