Skip to content

Commit

Permalink
Merge pull request #32 from sam42352352/layouts-filter-changes
Browse files Browse the repository at this point in the history
Facilitate external access to the AjaxPaging object
  • Loading branch information
emodric authored Nov 14, 2023
2 parents 4ca4556 + a8b0b1c commit 71f3d96
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions bundles/LayoutsBundle/Resources/es6/ajax-paging.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class AjaxPaging {
this.loadInitial = this.el.hasAttribute('data-load-initial');
this.baseUrl = this.el.dataset.baseUrl;

this.el.ajaxPaging = this;

this.init();
}

Expand All @@ -47,18 +49,13 @@ class AjaxPaging {

if (this.totalPages > 1) {
this.renderNavigation();
} else {
this.nav.forEach((pager) => {
pager.removeAttribute('data-template');
});
}

this.setupEvents();
}

renderNavigation() {
this.nav.forEach((pager) => {
pager.removeAttribute('data-template');
pager.innerHTML = templateEngine(this.pagerData.template, { pages: this.totalPages, page: this.page, url: this.generateUrl.bind(this) }); // eslint-disable-line no-param-reassign
});
}
Expand Down

0 comments on commit 71f3d96

Please sign in to comment.