markocupic / contao-news-infinite-scroll-bundle

Contao 4 module: Add Infinite Scroll to the Contao Newslist Module
4 stars 1 forks source link

Variable in for loop is a String #10

Closed rainermueller closed 3 years ago

rainermueller commented 3 years ago

We upgraded from 1.0.5 to 1.3.4 version, the infinite scroll stopped working.

The idLast variable in news_infinite_scroll.js is of type String.

                // Generate all urls from first to last
                for (i = idNext; i <= idLast; i++) {
                    let url = hrefNext.replace(regexpNext, 'page_n' + idModule + '=' + i);
                    _arrUrls.push(url);
                }

e.g. idNext = 2 and idLast = 17 will not push any URL to _arrUrls. Using parseInt function solves the issue.

As workaround we need to restrict the number of pagination links.

Gesamtzahl der Beiträge - 25 (instead of 0) Elemente pro Seite - 5

markocupic commented 3 years ago

Schau mir das heute mal an. Lustigerweise funktioniert die Extension hier.