mirror of
https://github.com/simon987/sist2.git
synced 2025-04-19 18:26:43 +00:00
Add preloader (UI Tweak)
This commit is contained in:
parent
85ab2858f6
commit
7be6234f0d
File diff suppressed because one or more lines are too long
@ -1,4 +1,9 @@
|
|||||||
body {overflow-y:scroll;}
|
body {overflow-y:scroll;}
|
||||||
|
|
||||||
|
.progress {
|
||||||
|
margin-top: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
}
|
}
|
||||||
|
@ -242,6 +242,17 @@ function createDocCard(hit) {
|
|||||||
return docCard;
|
return docCard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function makePreloader() {
|
||||||
|
const elem = document.createElement("div");
|
||||||
|
elem.setAttribute("class", "progress");
|
||||||
|
const bar = document.createElement("div");
|
||||||
|
bar.setAttribute("class", "progress-bar progress-bar-striped progress-bar-animated");
|
||||||
|
bar.setAttribute("style", "width: 100%");
|
||||||
|
elem.appendChild(bar);
|
||||||
|
|
||||||
|
return elem;
|
||||||
|
}
|
||||||
|
|
||||||
function makePageIndicator(searchResult) {
|
function makePageIndicator(searchResult) {
|
||||||
let pageIndicator = document.createElement("div");
|
let pageIndicator = document.createElement("div");
|
||||||
pageIndicator.setAttribute("class", "page-indicator shadow-sm bg-light font-weight-light");
|
pageIndicator.setAttribute("class", "page-indicator shadow-sm bg-light font-weight-light");
|
||||||
|
@ -193,12 +193,16 @@ function search() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
searchBusy = true;
|
searchBusy = true;
|
||||||
|
|
||||||
//Clear old search results
|
//Clear old search results
|
||||||
let searchResults = document.getElementById("searchResults");
|
let searchResults = document.getElementById("searchResults");
|
||||||
while (searchResults.firstChild) {
|
while (searchResults.firstChild) {
|
||||||
searchResults.removeChild(searchResults.firstChild);
|
searchResults.removeChild(searchResults.firstChild);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const preload = makePreloader();
|
||||||
|
searchResults.appendChild(preload);
|
||||||
|
|
||||||
let query = searchBar.value;
|
let query = searchBar.value;
|
||||||
let condition = $("#barToggle").prop("checked") ? "must" : "should";
|
let condition = $("#barToggle").prop("checked") ? "must" : "should";
|
||||||
let filters = [
|
let filters = [
|
||||||
@ -257,6 +261,7 @@ function search() {
|
|||||||
}).then(searchResult => {
|
}).then(searchResult => {
|
||||||
scroll_id = searchResult["_scroll_id"];
|
scroll_id = searchResult["_scroll_id"];
|
||||||
|
|
||||||
|
preload.remove();
|
||||||
//Search stats
|
//Search stats
|
||||||
searchResults.appendChild(makeStatsCard(searchResult));
|
searchResults.appendChild(makeStatsCard(searchResult));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user