File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ public function showing(?array $options = [])
205205 }
206206
207207 // only display results when total count is more than 0
208- echo "<span class=' {$ settings ['span ' ]}' style='display: inline-block; text-align: center; padding: 0;'>
208+ echo "<span data-pagination-showing class=' {$ settings ['span ' ]}' style='display: inline-block; text-align: center; padding: 0;'>
209209 {$ formatDisplayText }
210210 </span>
211211 " ;
Original file line number Diff line number Diff line change @@ -70,8 +70,19 @@ function closestAnchor(el){
7070 var newContainer = doc.querySelector(targetSelector);
7171 var newScope = doc.querySelector('[data-pagination-scope]');
7272 if(!newContainer || !newScope){ window.location.href = href; return; }
73+
7374 container.innerHTML = newContainer.innerHTML;
75+
76+ // Replace controls to keep next/prev in sync
7477 scope.replaceWith(newScope);
78+
79+ // Update "showing" summary if present on the page
80+ var newShowing = doc.querySelector('[data-pagination-showing]');
81+ var curShowing = document.querySelector('[data-pagination-showing]');
82+ if(newShowing && curShowing){
83+ curShowing.innerHTML = newShowing.innerHTML;
84+ }
85+
7586 try { window.history.pushState({}, '', href); } catch(_e) {}
7687 })
7788 .catch(function(){ window.location.href = href; })
Original file line number Diff line number Diff line change @@ -78,6 +78,13 @@ function closestAnchor(el){
7878 // Replace controls to keep next/prev in sync
7979 scope.replaceWith(newScope);
8080
81+ // Update "showing" summary if present on the page
82+ var newShowing = doc.querySelector('[data-pagination-showing]');
83+ var curShowing = document.querySelector('[data-pagination-showing]');
84+ if(newShowing && curShowing){
85+ curShowing.innerHTML = newShowing.innerHTML;
86+ }
87+
8188 try { window.history.pushState({}, '', href); } catch(_e) {}
8289 })
8390 .catch(function(){ window.location.href = href; })
You can’t perform that action at this time.
0 commit comments