[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Fix pagination scroll on tracker items comments

"John Livingston \(@JohnXLivingston\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a2939ee78b90_38194d1c5353e@gitlab-sidekiq-low-urgency-cpu-bound-v2-5488cfffb7-v4vd5.mail>

John Livingston pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
fbeb14ca by John Livingston at 2026-06-10T12:00:12+02:00
[FIX] Fix pagination scroll on tracker items comments
---
* [FIX] Fix pagination scroll on tracker items comments

When changing page on tracker item comments, it was always scrolling up,
to the first comment. This commit change the behaviour by only scrolling
up when loading the first page.

See merge request tikiwiki/tiki!10479

- - - - -


1 changed file:

- lib/core/Services/Comment/Controller.php


Changes:

=====================================
lib/core/Services/Comment/Controller.php
=====================================
@@ -94,11 +94,16 @@ class Services_Comment_Controller
                         \$.service('comment', 'list'),
                         {type:'$type', objectId:'$objectId', offset: comment_offset},
                         function () {
-                            \$('html, body').animate({
-                                    scrollTop: \$commentContainer.offset().top
-                                }, 2000, function () {
-                                    \$commentContainer.tikiModal();
-                                });
+                            if (comment_offset == 0) {
+                                // If we want to load the first page, we have to go up.
+                                \$('html, body').animate({
+                                        scrollTop: \$commentContainer.offset().top
+                                    }, 2000, function () {
+                                        \$commentContainer.tikiModal();
+                                    });
+                            } else {
+                                \$commentContainer.tikiModal();
+                            }
                         }
                     );
                 return false;";



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/fbeb14ca5c384e9c3eafb2537704ddfcc44cd412

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/fbeb14ca5c384e9c3eafb2537704ddfcc44cd412
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.