Merge branch 'master' into search_placeholder
This commit is contained in:
@@ -25,6 +25,11 @@
|
|||||||
background-color: var(--secondary-color);
|
background-color: var(--secondary-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#single .page-content img {
|
||||||
|
max-width: 100%;
|
||||||
|
border-radius: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
#single .page-content a {
|
#single .page-content a {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|||||||
+8
-2
@@ -6,7 +6,10 @@ async function searchOnChange(evt) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (searchQuery !== "") {
|
if (searchQuery !== "") {
|
||||||
let searchJson = await fetch("/index.json").then((res) => res.json());
|
if (!window.searchJson) {
|
||||||
|
window.searchJson = await fetch("/index.json").then((res) => res.json());
|
||||||
|
}
|
||||||
|
|
||||||
let searchResults = searchJson.filter((item) => {
|
let searchResults = searchJson.filter((item) => {
|
||||||
let res = false;
|
let res = false;
|
||||||
if (item.title && item.description && item.content) {
|
if (item.title && item.description && item.content) {
|
||||||
@@ -64,7 +67,9 @@ async function searchOnChange(evt) {
|
|||||||
|
|
||||||
function alignSearchContent() {
|
function alignSearchContent() {
|
||||||
const searchButtonEle = document.querySelectorAll("#search");
|
const searchButtonEle = document.querySelectorAll("#search");
|
||||||
if (searchButtonEle.value !== "") {
|
// check if search value is not empty
|
||||||
|
for (let i = 0; i < searchButtonEle.length; i++) {
|
||||||
|
if (searchButtonEle[i].value !== "") {
|
||||||
let searchButtonPosition;
|
let searchButtonPosition;
|
||||||
if (window.innerWidth > 768) {
|
if (window.innerWidth > 768) {
|
||||||
searchButtonPosition = searchButtonEle[0].getBoundingClientRect();
|
searchButtonPosition = searchButtonEle[0].getBoundingClientRect();
|
||||||
@@ -82,6 +87,7 @@ function alignSearchContent() {
|
|||||||
searchButtonPosition.left + "px";
|
searchButtonPosition.left + "px";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function resetSearch(e) {
|
function resetSearch(e) {
|
||||||
if (
|
if (
|
||||||
|
|||||||
Reference in New Issue
Block a user