Skip to content

Filter and paginate apps with AJAX requests in repo apps

Filter and paginate apps with AJAX requests

When JavaScript is available, Repomaker acts like before.

Otherwise it reacts on a scroll event in MDL's content container. Every time the user scrolls to the bottom closer than 800 pixels, an AJAX request is made to the window URL, extended by Django's built-in pagination paramter ?page=. On first load it will load the second page and saves '2' to HTML's session storage. When the user scrolls again close to the bottom, the script increases the page count by one and requests again. If there are no more apps, Repomaker returns 404 resulting in disabling the script's pagination functionality.

When Repomaker returns some apps, the script gets the first app card and uses this as a template for the loaded ones. It replaces the icon, title and other properties of the app and appends it to the page.

Fixes #98 (closed).

Edited by username-removed-124398

Merge request reports