Skip to content

Commit

Permalink
Improve small screen searching
Browse files Browse the repository at this point in the history
  • Loading branch information
xremming committed Dec 11, 2023
1 parent 4d9ebb4 commit 16a63ce
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 14 deletions.
4 changes: 0 additions & 4 deletions public/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ 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
10 changes: 1 addition & 9 deletions public/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ hr {
z-index: var(--z-search-modal);

background-color: var(--color-background-secondary);
padding: 1rem;
padding: 0 0.5rem;
border-radius: 0 0 var(--border-radius) var(--border-radius);
box-shadow: var(--box-shadow);
}
Expand All @@ -311,14 +311,6 @@ hr {
}
}

#search-modal > *:first-child {
margin-top: 0;
}

#search-modal > *:last-child {
margin-bottom: 0;
}

.search-result {
margin: 0.5rem 0;
padding: 0.5rem;
Expand Down
1 change: 0 additions & 1 deletion template/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ <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 16a63ce

Please sign in to comment.