1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2024-12-19 20:12:52 +02:00

Update search page style

- Fix having multiple vertical scrollbars
 - Update icons lazy loading accordingly
This commit is contained in:
Fadi Hania 2023-06-05 22:42:31 +03:00 committed by Fini
parent cd2e548e98
commit 1df198249a
2 changed files with 8 additions and 5 deletions

View File

@ -110,9 +110,9 @@ a.nerd-font-button:before {
} }
#main .nerd-font-cheat-sheet { #main .nerd-font-cheat-sheet {
max-height: 520px; // max-height: 520px;
overflow-x: hidden; overflow-x: hidden;
overflow-y: scroll; // overflow-y: scroll;
margin-top: 40px; margin-top: 40px;
max-width: none; max-width: none;
justify-content: center; justify-content: center;

View File

@ -23,9 +23,12 @@ document.addEventListener('DOMContentLoaded', function () {
} }
)); ));
elementGlyphCheatSheet.onscroll = function () { document.onscroll = function () {
const threshold = 10; const elementDoc = document.documentElement;
if ((elementGlyphCheatSheet.offsetHeight + elementGlyphCheatSheet.scrollTop + threshold) >= elementGlyphCheatSheet.scrollHeight) { const elementIconsTop = elementGlyphCheatSheet.getBoundingClientRect().top + elementDoc.scrollTop;
if (elementDoc.clientHeight + elementDoc.scrollTop >=
elementGlyphCheatSheet.clientHeight + elementIconsTop) {
console.log("load more search results"); console.log("load more search results");
loadMoreSearchResults(); loadMoreSearchResults();
} }