-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a search box on the navigation bar #255
Conversation
assets/main.js
Outdated
const item = document.createElement('li'); | ||
item.innerHTML = `<a class="dropdown-item" href="${result.item.permalink}"> | ||
${result.item.title} | ||
<span style="font-size: 0.8em; color: #888;">(${result.item.dialect})</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use Bootstrap classes here instead of an inline style
? I think Bootstrap has the classes you need for what you are doing here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the color I got closer colors, which I can use. For font-size there is sizes for different headings but I couldn't find for small variations
Yeah, maybe try an input group with the search icon? https://getbootstrap.com/docs/5.3/forms/input-group/. We already have https://icons.getbootstrap.com available on the site for you to use |
assets/main.js
Outdated
|
||
function executeSearch(searchQuery) { | ||
// TODO | ||
// show(document.querySelector('.search-loading')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this? Seems pretty instantaneous to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe not right now, I don't know how fast it may work when there are all the dialects present. Maybe i'll just have a statement here to remind it?
assets/main.js
Outdated
} | ||
}); | ||
|
||
document.addEventListener('click', function(event) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
document.addEventListener('click', function(event) { | |
document.addEventListener('click', (event) => { |
Already left some comments but man, this is looking great already. Very, very cool |
assets/main.js
Outdated
} | ||
}); | ||
|
||
document.addEventListener('click', (event) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can get rid of this. I get the idea of closing automatically, but I think we should let HTML do its default job!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the use of this function is user can come out of the search without navigating to other page
temp2.mp4
temp11.mp4
Finally, this is really cool and I'd like to ship this ASAP. Let's think about mobile support on a different PR, and just add the following to hide the search bar on mobile for the time being: diff --git a/layouts/partials/navigation.html b/layouts/partials/navigation.html
index e5dec5a..3e9708b 100644
--- a/layouts/partials/navigation.html
+++ b/layouts/partials/navigation.html
@@ -5,7 +5,7 @@
height="42" width="42" class="me-1">
<span class="align-middle">JSON Schema Docs</span>
</a>
- <div class="position-relative me-3 flex-grow-1">
+ <div class="position-relative me-3 flex-grow-1 d-none d-lg-block">
<div class="input-group">
<span class="input-group-text" id="basic-addon1">
<i class="bi bi-search"></i> |
Done 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Thanks a lot!
@Era-cell Can you resolve the conflict? |
I have resolved it 👍 |
@Era-cell CI seems to be complaining about the JavaScript file:
|
Okay, seems good now. The power went off yesterday 😅 |
Thanks a lot! |
Thank you too, website looks very good 💖 |
@jviotti review on this PR and can we better the search bar, I feel we should have the search logo 🤔