[bug fix] search enter, single pagination

This commit is contained in:
zzossig 2020-02-03 10:59:33 +09:00
parent 656d955dbf
commit 41a5773d2e
2 changed files with 23 additions and 24 deletions

View File

@ -881,9 +881,8 @@
document.querySelector(".search-content").scrollTop = overflowedPixel + items[activeIndex].getBoundingClientRect().height;
}
} else if (e.key === 'Enter' || keyCode === 13) {
var currentItemLink = items[activeIndex].getAttribute('href');
if (currentItemLink) {
location.href = currentItemLink;
if (items[activeIndex] && items[activeIndex].getAttribute('href')) {
location.href = items[activeIndex].getAttribute('href');
}
} else if (e.key === 'Escape' || keyCode === 27) {
e.target.value = null;

View File

@ -1,38 +1,38 @@
<div class="grow"></div>
<nav class="pagination-single">
{{ if eq ($.Param "languagedir") "ltr" }}
{{ if .PrevPage }}
<a href="{{ .PrevPage.Permalink }}" class="pagination-single__left">
{{ if eq ($.Param "languagedir") "rtl" }}
{{ if .NextPage }}
<a href="{{ .NextPage.Permalink }}" class="pagination-single__right">
<div class="pagination-single__icon">
{{ partial "svgs/arrow/arrow-back.svg" (dict "width" 25 "height" 25) }}
{{ partial "svgs/arrow/arrow-forward.svg" (dict "width" 25 "height" 25) }}
</div>
<div class="pagination-single__left-title">{{ .PrevPage.Title }}</div>
<div class="pagination-single__right-title">{{ .NextPage.Title }}</div>
</a>
{{ end }}
<div class="grow"></div>
{{ if .NextPage }}
<a href="{{ .NextPage.Permalink }}" class="pagination-single__right">
<div class="pagination-single__right-title">{{ .NextPage.Title }}</div>
{{ if .PrevPage }}
<a href="{{ .PrevPage.Permalink }}" class="pagination-single__left">
<div class="pagination-single__left-title">{{ .PrevPage.Title }}</div>
<div class="pagination-single__icon">
{{ partial "svgs/arrow/arrow-forward.svg" (dict "width" 25 "height" 25) }}
{{ partial "svgs/arrow/arrow-back.svg" (dict "width" 25 "height" 25) }}
</div>
</a>
{{ end }}
{{ else }}
{{ if .NextPage }}
<a href="{{ .NextPage.Permalink }}" class="pagination-single__right">
{{ if .PrevPage }}
<a href="{{ .PrevPage.Permalink }}" class="pagination-single__left">
<div class="pagination-single__icon">
{{ partial "svgs/arrow/arrow-forward.svg" (dict "width" 25 "height" 25) }}
{{ partial "svgs/arrow/arrow-back.svg" (dict "width" 25 "height" 25) }}
</div>
<div class="pagination-single__right-title">{{ .NextPage.Title }}</div>
<div class="pagination-single__left-title">{{ .PrevPage.Title }}</div>
</a>
{{ end }}
<div class="grow"></div>
{{ if .PrevPage }}
<a href="{{ .PrevPage.Permalink }}" class="pagination-single__left">
<div class="pagination-single__left-title">{{ .PrevPage.Title }}</div>
{{ if .NextPage }}
<a href="{{ .NextPage.Permalink }}" class="pagination-single__right">
<div class="pagination-single__right-title">{{ .NextPage.Title }}</div>
<div class="pagination-single__icon">
{{ partial "svgs/arrow/arrow-back.svg" (dict "width" 25 "height" 25) }}
{{ partial "svgs/arrow/arrow-forward.svg" (dict "width" 25 "height" 25) }}
</div>
</a>
{{ end }}