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 {
max-height: 520px;
// max-height: 520px;
overflow-x: hidden;
overflow-y: scroll;
// overflow-y: scroll;
margin-top: 40px;
max-width: none;
justify-content: center;

View File

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