forked from abaevdict/abaev-basex
added search loader
This commit is contained in:
parent
fe72db6c49
commit
3855cf6bf0
3 changed files with 22 additions and 2 deletions
|
@ -542,3 +542,18 @@ https://github.com/frontaid/natural-selection
|
||||||
float: left;
|
float: left;
|
||||||
padding-right: 0.5vw;
|
padding-right: 0.5vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.loader {
|
||||||
|
border: 2px solid #f3f3f3;
|
||||||
|
border-radius: 50%;
|
||||||
|
border-top: 2px solid #3498db;
|
||||||
|
width: 2ex;
|
||||||
|
height: 2ex;
|
||||||
|
-webkit-animation: spin 2s linear infinite; /* Safari */
|
||||||
|
animation: spin 2s linear infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes spin {
|
||||||
|
0% { transform: rotate(0deg); }
|
||||||
|
100% { transform: rotate(360deg); }
|
||||||
|
}
|
||||||
|
|
|
@ -1,10 +1,15 @@
|
||||||
$( document ).ready(function() {
|
$( document ).ready(function() {
|
||||||
// GLOBALS
|
// GLOBALS;
|
||||||
|
|
||||||
// Link elements that do not have href out of the box
|
// Link elements that do not have href out of the box
|
||||||
$('.link').on("click", function () {
|
$('.link').on("click", function () {
|
||||||
window.location=$(this)[0].dataset.href+window.location.search+window.location.hash;
|
window.location=$(this)[0].dataset.href+window.location.search+window.location.hash;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#abv-search').on("submit", function () {
|
||||||
|
$('#abv-search-icon').replaceWith('<div class="loader"></div>');
|
||||||
|
});
|
||||||
|
|
||||||
// init Infinite Scroll
|
// init Infinite Scroll
|
||||||
$('main').infiniteScroll({
|
$('main').infiniteScroll({
|
||||||
path: '.pagination__next',
|
path: '.pagination__next',
|
||||||
|
|
|
@ -105,7 +105,7 @@ declare function page:header($lang as xs:string, $href-other as xs:string) {
|
||||||
aria-label="Search" />
|
aria-label="Search" />
|
||||||
{if (not(session:get('searchQuery'))) then
|
{if (not(session:get('searchQuery'))) then
|
||||||
<button type="submit">
|
<button type="submit">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg"
|
<svg id="abv-search-icon" xmlns="http://www.w3.org/2000/svg"
|
||||||
width="16" height="16"
|
width="16" height="16"
|
||||||
viewBox="0 0 16 16"
|
viewBox="0 0 16 16"
|
||||||
fill="currentColor" class="bi bi-search">
|
fill="currentColor" class="bi bi-search">
|
||||||
|
|
Loading…
Add table
Reference in a new issue