django-jet icon indicating copy to clipboard operation
django-jet copied to clipboard

Pagination is rendered incorrectry

Open vanyakosmos opened this issue 5 years ago • 5 comments

There are 26 pages of events, and pagination looks like this:

Screenshot 2020-02-19 at 13 21 45

Django version:

Django==2.2.10
django-jet==1.0.8

With django 2.1 everything is fine

vanyakosmos avatar Feb 19 '20 11:02 vanyakosmos

Hello @vanyakosmos , If it this issue is still actual for you please check the small patch:

\diff --git a/jet/static/jet/js/src/layout-updaters/paginator.js b/jet/static/jet/js/src/layout-updaters/paginator.js
index 02e6dcb..fb309b7 100644
--- a/jet/static/jet/js/src/layout-updaters/paginator.js
+++ b/jet/static/jet/js/src/layout-updaters/paginator.js
@@ -16,7 +16,7 @@ PaginatorUpdater.prototype = {
             if (($node.prev().prop('tagName') == 'A' || $node.prev().prop('tagName') == 'SPAN')
                 && ($node.next().prop('tagName') == 'A' || $node.next().prop('tagName') == 'SPAN')) {
 
-                if ($.trim($node.text()) == '...') {
+                if ($.trim($node.text()) == '…') {
                     $node.wrap($('<span>').addClass('disabled'));
                 } else if ($.trim($node.text()) == '') {
                     $node.remove();
--

akamoroz avatar Feb 25 '20 10:02 akamoroz

@akamoroz Thanks. Changing that line to if (['...', '…'].includes($.trim($node.text()))) { solved the problem. But I will keep the issue open until it fixed in jet (if ever)

vanyakosmos avatar Mar 04 '20 22:03 vanyakosmos

I am unable to fix the error with the line of code above. Do you need to do anything else?

Alessyo avatar Mar 15 '20 10:03 Alessyo

yeah, you will also need to rebuild js bundle after making any changes in js files. Run gulp scripts

vanyakosmos avatar Mar 15 '20 10:03 vanyakosmos

Does anybody have a proper solution to this issue?

petersenpeter avatar Oct 27 '21 12:10 petersenpeter