mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-25 08:16:19 +01:00
fix(paginator): fix Paginator render bug
This commit is contained in:
parent
69aa0cd779
commit
e4627fe297
1 changed files with 4 additions and 4 deletions
|
@ -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 -}}
|
||||
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue