aboutsummaryrefslogtreecommitdiff
path: root/static/js
diff options
context:
space:
mode:
authorsptaule <lecas83@gmail.com>2022-01-27 18:10:37 +0100
committersptaule <lecas83@gmail.com>2022-01-27 18:10:37 +0100
commit1da8b90340235753b935a880d797cb796700d151 (patch)
treee6c98c0999eb3b58e3ebfd72b88c4379a8fa51d0 /static/js
parenta8d6c4635cf4e49320ebee8ee6f348769b65ffa8 (diff)
downloadgaragehq.deuxfleurs.fr-1da8b90340235753b935a880d797cb796700d151.tar.gz
garagehq.deuxfleurs.fr-1da8b90340235753b935a880d797cb796700d151.zip
Doc refactor, doc and index QoL, fix search: working on every page
Diffstat (limited to 'static/js')
-rwxr-xr-xstatic/js/site.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/static/js/site.js b/static/js/site.js
index f764289..d8e0d69 100755
--- a/static/js/site.js
+++ b/static/js/site.js
@@ -112,7 +112,7 @@ function makeTeaser(body, terms) {
function formatSearchResultItem(item, terms) {
return (
- `<a href='${item.ref}' class='group flex flex-col space-y-2 hover:bg-gray-100 p-2 rounded'>` +
+ `<a href='${item.ref}' class='group flex flex-col space-y-2 hover:bg-gray-100 p-2 rounded focus:outline outline-garage-orange'>` +
`<h1 class='text-garage-orange font-semibold'>` + `${item.doc.title}` + `</h1>` +
`<div class='content mt-2'>` +
`${makeTeaser(item.doc.body, terms)}` +
@@ -168,9 +168,11 @@ function search() {
}
function openSearchModal() {
+ var baseUrl = window.location.protocol + "//" + window.location.host;
+ var indexScriptPath = baseUrl + '/search_index.en.js';
if (indexScriptLoaded === false) {
var indexScript = document.createElement('script');
- indexScript.setAttribute('src', './search_index.en.js');
+ indexScript.setAttribute('src', indexScriptPath);
document.head.appendChild(indexScript);
indexScriptLoaded = true;
}