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();
}