Skip to content

Commit

Permalink
Even more hacky small screen updates
Browse files Browse the repository at this point in the history
  • Loading branch information
xremming committed Dec 11, 2023
1 parent 5d3e4ea commit 4d9ebb4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions public/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ function main() {
var search = document.querySelector("#search");
var modal = document.querySelector("#search-modal");

window.closeSearchModal = function () {
modal.classList.add("hide-search-modal");
};

function gotoSearchResult(idx) {
var i = idx;
if (idx === null) i = state.selected;
Expand Down
1 change: 1 addition & 0 deletions template/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ <h2 class="main-heading"><i>Magic: the Gathering</i> Comprehensive Rules</h2>
.querySelector("#content")
.addEventListener("click", function() {
window.closeTocIfSmallScreen();
if (window.closeSearchModal) window.closeSearchModal();
});

// When the window is small (toc is on top of content), clicking a link
Expand Down

0 comments on commit 4d9ebb4

Please sign in to comment.