Fetch upstream (#5)
* fix(#744): Escape special characters in title (#745) * add matt artist as sponsor * Fix margin top alignment issue on Safari (#750) * Update README.md * Update README.md * Update README.md * Update README.md * Remove references to any public Staticman API instance (#775) * Update CHANGELOG.md * Adding option for Medium Social Link at footer (#784) * Itch.io social link (#788) * Update CHANGELOG.md * Add support for Cloudflare analytics (#798) * Include Reddit in share options of posts (#815) * add search to the navbar using 'post_search' config param * Update CHANGELOG.md * ui: make sure search results dont have underline until hovered * search feature: make sure page scrollbar disappears when searching but a scrollbar for search items shows if needed * update changelog Co-authored-by: Dmitry <dmitry.b.danilov@gmail.com> Co-authored-by: Dean Attali <dean@attalitech.com> Co-authored-by: Amy Troschinetz <lexicalunit@lexicalunit.com> Co-authored-by: Dean Attali <daattali@gmail.com> Co-authored-by: Vincent Tam <VincentTam@users.noreply.github.com> Co-authored-by: Diksha Verma <112dikshaverma@gmail.com> Co-authored-by: Emaleth <Emaleth@protonmail.com> Co-authored-by: Ari Kalfus <dev@artis3nal.com> Co-authored-by: Leedan <l33d4n@gmail.com> Co-authored-by: Marco Blessing <marco.blessing@komm.one>
This commit is contained in:
@ -27,6 +27,8 @@ var BeautifulJekyllJS = {
|
||||
|
||||
// show the big header image
|
||||
BeautifulJekyllJS.initImgs();
|
||||
|
||||
BeautifulJekyllJS.initSearch();
|
||||
},
|
||||
|
||||
initNavbar : function() {
|
||||
@ -108,6 +110,30 @@ var BeautifulJekyllJS = {
|
||||
} else {
|
||||
$(".img-desc").hide();
|
||||
}
|
||||
},
|
||||
|
||||
initSearch : function() {
|
||||
if (!document.getElementById("beautifuljekyll-search-overlay")) {
|
||||
return;
|
||||
}
|
||||
|
||||
$("#nav-search-link").click(function(e) {
|
||||
e.preventDefault();
|
||||
$("#beautifuljekyll-search-overlay").show();
|
||||
$("#nav-search-input").focus().select();
|
||||
$("body").addClass("overflow-hidden");
|
||||
});
|
||||
$("#nav-search-exit").click(function(e) {
|
||||
e.preventDefault();
|
||||
$("#beautifuljekyll-search-overlay").hide();
|
||||
$("body").removeClass("overflow-hidden");
|
||||
});
|
||||
$(document).on('keyup', function(e) {
|
||||
if (e.key == "Escape") {
|
||||
$("#beautifuljekyll-search-overlay").hide();
|
||||
$("body").removeClass("overflow-hidden");
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user