[bug fix] search enter, single pagination
This commit is contained in:
parent
656d955dbf
commit
41a5773d2e
|
@ -635,7 +635,7 @@
|
|||
searchResults = document.getElementById('search-results');
|
||||
searchMenu = document.getElementById('search-menu');
|
||||
searchResults.setAttribute('class', 'dropdown is-active');
|
||||
|
||||
|
||||
var content = document.createElement('div');
|
||||
content.setAttribute('class', 'dropdown-content search-content');
|
||||
|
||||
|
@ -662,7 +662,7 @@
|
|||
searchMenu.appendChild(content);
|
||||
}
|
||||
|
||||
function renderSearchHighlightResults(results) {
|
||||
function renderSearchHighlightResults(results) {
|
||||
searchResults = document.getElementById('search-results');
|
||||
searchMenu = document.getElementById('search-menu');
|
||||
searchResults.setAttribute('class', 'dropdown is-active');
|
||||
|
@ -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;
|
||||
|
|
|
@ -1,24 +1,6 @@
|
|||
<div class="grow"></div>
|
||||
<nav class="pagination-single">
|
||||
{{ if eq ($.Param "languagedir") "ltr" }}
|
||||
{{ if .PrevPage }}
|
||||
<a href="{{ .PrevPage.Permalink }}" class="pagination-single__left">
|
||||
<div class="pagination-single__icon">
|
||||
{{ partial "svgs/arrow/arrow-back.svg" (dict "width" 25 "height" 25) }}
|
||||
</div>
|
||||
<div class="pagination-single__left-title">{{ .PrevPage.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>
|
||||
<div class="pagination-single__icon">
|
||||
{{ partial "svgs/arrow/arrow-forward.svg" (dict "width" 25 "height" 25) }}
|
||||
</div>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ if eq ($.Param "languagedir") "rtl" }}
|
||||
{{ if .NextPage }}
|
||||
<a href="{{ .NextPage.Permalink }}" class="pagination-single__right">
|
||||
<div class="pagination-single__icon">
|
||||
|
@ -36,5 +18,23 @@
|
|||
</div>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ if .PrevPage }}
|
||||
<a href="{{ .PrevPage.Permalink }}" class="pagination-single__left">
|
||||
<div class="pagination-single__icon">
|
||||
{{ partial "svgs/arrow/arrow-back.svg" (dict "width" 25 "height" 25) }}
|
||||
</div>
|
||||
<div class="pagination-single__left-title">{{ .PrevPage.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>
|
||||
<div class="pagination-single__icon">
|
||||
{{ partial "svgs/arrow/arrow-forward.svg" (dict "width" 25 "height" 25) }}
|
||||
</div>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</nav>
|
Loading…
Reference in New Issue