mirror of
https://github.com/welpo/tabi.git
synced 2025-10-11 07:46:15 +02:00
🎨 refactor: format JS with Prettier (#240)
This commit is contained in:
parent
39fc4ece61
commit
b6a89e6370
12 changed files with 93 additions and 62 deletions
|
@ -4,13 +4,13 @@ function initIsso() {
|
|||
const commentsDiv = document.querySelector('.comments');
|
||||
if (commentsDiv) {
|
||||
// Get the lazy-loading setting from the div.
|
||||
const lazyLoading = commentsDiv.getAttribute('data-lazy-loading') === "true";
|
||||
const lazyLoading = commentsDiv.getAttribute('data-lazy-loading') === 'true';
|
||||
|
||||
// If lazy-loading is enabled, create an Intersection Observer and use it.
|
||||
if (lazyLoading) {
|
||||
const observer = new IntersectionObserver(entries => {
|
||||
const observer = new IntersectionObserver((entries) => {
|
||||
// Loop over the entries.
|
||||
entries.forEach(entry => {
|
||||
entries.forEach((entry) => {
|
||||
// If the element is in the viewport, initialize Isso.
|
||||
if (entry.isIntersecting) {
|
||||
loadIsso(commentsDiv);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue