mirror of
https://github.com/thangisme/notes.git
synced 2024-12-22 07:56:25 -05:00
Improved search on mobile
This commit is contained in:
parent
8310df593c
commit
a6f2ed8c6c
@ -248,6 +248,14 @@
|
||||
transition: opacity ease 200ms, width 0s, height 0s;
|
||||
}
|
||||
|
||||
body {
|
||||
overflow-y: hidden;
|
||||
|
||||
@include mq(md) {
|
||||
overflow-y: scroll;
|
||||
}
|
||||
}
|
||||
|
||||
@include mq(md) {
|
||||
.main {
|
||||
position: absolute;
|
||||
|
@ -111,6 +111,7 @@ function initSearch() {
|
||||
var docs = docs;
|
||||
var searchInput = document.getElementById('search-input');
|
||||
var searchResults = document.getElementById('search-results');
|
||||
var mainHeader = document.getElementById('main-header');
|
||||
|
||||
function clearResults() {
|
||||
searchResults.innerHTML = '';
|
||||
@ -140,6 +141,7 @@ function initSearch() {
|
||||
});
|
||||
|
||||
if (results.length > 0) {
|
||||
window.scroll(0, window.scrollY + mainHeader.getBoundingClientRect().top);
|
||||
document.documentElement.classList.add('search-active');
|
||||
|
||||
var resultsList = document.createElement('ul');
|
||||
|
Loading…
Reference in New Issue
Block a user