Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
fix(paginator): fix Paginator render bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonzq committed Nov 23, 2019
1 parent 69aa0cd commit e4627fe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions layouts/partials/paginator.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{ if gt $.paginator.TotalPages 1 -}}
{{ if gt $.Paginator.TotalPages 1 -}}
<ul class="pagination">
{{- $.Scratch.Set "paginator.ellipsed" false -}}
{{ range $.paginator.Pagers -}}
{{ range $.Paginator.Pagers -}}
{{ $right := sub .TotalPages .PageNumber -}}
{{ $showNumber := or (le .PageNumber 1) (eq $right 0) -}}
{{ $showNumber := or $showNumber (and (gt .PageNumber (sub $.paginator.PageNumber 3)) (lt .PageNumber (add $.paginator.PageNumber 3))) -}}
{{ $showNumber := or $showNumber (and (gt .PageNumber (sub $.Paginator.PageNumber 3)) (lt .PageNumber (add $.Paginator.PageNumber 3))) -}}
{{ if $showNumber -}}
{{ $.Scratch.Set "paginator.ellipsed" false -}}
{{ $.Scratch.Set "paginator.shouldEllipse" false -}}
Expand All @@ -13,7 +13,7 @@
{{ $.Scratch.Set "paginator.ellipsed" true -}}
{{ end -}}
{{ if $showNumber -}}
<li class="page-item {{ if eq . $.paginator }}active{{ end }}">
<li class="page-item {{ if eq . $.Paginator }}active{{ end }}">
<span class="page-link">
<a href="{{ .URL }}">{{ .PageNumber }}</a>
</span>
Expand Down

0 comments on commit e4627fe

Please sign in to comment.