Permalink
Browse files

🐛 fix pagination if not multiple of column count

If pagination count and column count are not multiples of each other, then the count needs to be
reset for the start of a new page to properly add the starting tags

Closes #81
  • Loading branch information...
micgro42 committed Jul 9, 2018
1 parent 02b9064 commit 73eb96b6b123171c0cbe4b7fc372cf75bf249ac2
Showing with 3 additions and 2 deletions.
  1. +3 −2 syntax.php
View
@@ -403,7 +403,7 @@ function _gallery($data){
$ret .= '</td>';
$i++;
// done with this row? cloase it
// done with this row? close it
$close_tr = true;
if($i % $data['cols'] == 0){
$ret .= '</tr>';
@@ -423,9 +423,10 @@ function _gallery($data){
$ret .= '</table>';
$ret .= '</div>';
$close_pg = false;
$i = 0; // reset counter to ensure next page is properly started
}
}
} // foreach
if ($close_tr){
// add remaining empty cells

0 comments on commit 73eb96b

Please sign in to comment.