1
1
mirror of https://github.com/neosubhamoy/neosubhamoy-portfolio.git synced 2025-12-20 01:09:35 +05:30

(feat): added search result loading spinner

This commit is contained in:
2023-12-04 21:36:22 +05:30
parent c8ae463ef6
commit 6bd36c6647
3 changed files with 21 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ const searchWin = document.getElementById("searchwindow");
const shareWin = document.getElementById("sharewindow");
const searchDef = document.getElementById("defresults");
const searchRes = document.getElementById("searchresults");
const spinner = document.getElementById("spinnercont");
const qrCode = document.getElementById("pageqrcode");
const linkInput = document.getElementById("pageurlinput");
const embedCode = document.getElementById("embedcodetag");
@@ -118,6 +119,8 @@ function perform_search(searchInput, searchDef, searchRes) {
searchDef.classList.add("hidden");
searchRes.classList.remove("hidden");
searchRes.classList.add("flex");
spinner.classList.remove("hidden");
spinner.classList.add("flex");
let searchString = searchInput.value;
$.ajax({
@@ -144,7 +147,8 @@ function perform_search(searchInput, searchDef, searchRes) {
console.error('error:', error);
},
complete: function() {
console.log("completed");
spinner.classList.remove("flex");
spinner.classList.add("hidden");
}
});
}