Skip to content

Conversation

@adearriba
Copy link

Sorry if this is not a great PR. It is the first I've done for public projects.

I added 2 events that extend the flexibility of the library:

  • ajaxinate.page:load : This event fires when a new page is loaded.
  • ajaxinate.scroll:end : This event fires when there is no more pages left to load.

I've had to add those in my code since the callback forces me to handle everything in 1 place instead of being able to handle different things in different places of the code.

Hope it helps the project.

Best,
@adearriba

@adearriba
Copy link
Author

The way to use these new events would be:

document.addEventListener('ajaxinate.page:load', event => {
    //event.detail.content contains the HTML element being added
    console.log(event.detail.content);
});
document.addEventListener('ajaxinate.scroll:end', event => {
    console.log('No more pages left');
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant