From 0aff6228e8dc6ec9dc9931a67507a45a4d3ae388 Mon Sep 17 00:00:00 2001 From: Samuel Raus Date: Tue, 14 Nov 2023 10:53:41 +0100 Subject: [PATCH] Facilitate external access to the AjaxPaging object --- bundles/LayoutsBundle/Resources/es6/ajax-paging.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bundles/LayoutsBundle/Resources/es6/ajax-paging.js b/bundles/LayoutsBundle/Resources/es6/ajax-paging.js index 4aa6a4a7e..a1d9e962f 100644 --- a/bundles/LayoutsBundle/Resources/es6/ajax-paging.js +++ b/bundles/LayoutsBundle/Resources/es6/ajax-paging.js @@ -31,6 +31,8 @@ class AjaxPaging { this.loadInitial = this.el.hasAttribute('data-load-initial'); this.baseUrl = this.el.dataset.baseUrl; + el.ajaxPaging = this; + this.init(); } @@ -47,10 +49,6 @@ class AjaxPaging { if (this.totalPages > 1) { this.renderNavigation(); - } else { - this.nav.forEach((pager) => { - pager.removeAttribute('data-template'); - }); } this.setupEvents(); @@ -58,7 +56,6 @@ class AjaxPaging { 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 }); }