Small fixes

This commit is contained in:
Augusto Gunsch
2021-12-30 13:50:39 -03:00
parent c5b0b930ec
commit a458302388
3 changed files with 15 additions and 3 deletions

View File

@@ -38,3 +38,7 @@ h1, h2, h3 {
body {
font-family: serif;
}
li {
margin-top: .2em;
}

View File

@@ -15,7 +15,7 @@ $(document).ready(() => {
getWord();
};
let searchBar = $('#search-bar');
const searchBar = $('#search-bar');
searchBar.autocomplete({
appendTo: '#search-form',
@@ -32,7 +32,7 @@ $(document).ready(() => {
setTimeout(() => e.currentTarget.select(), 100);
});
$('#search-form').on('submit', (e) => {
$('#search-form').on('submit', e => {
e.preventDefault();
let word = e.target[0].value
@@ -56,6 +56,9 @@ $(document).ready(() => {
window.scrollTo(0, 0);
searchBar.select();
searchBar.autocomplete('close');
// Sometimes autocomplete opens after close was called
// A better fix should be made
setTimeout(() => searchBar.autocomplete('close'), 1000);
}
function getCells(forms, tags) {
@@ -167,6 +170,11 @@ $(document).ready(() => {
html += sense.glosses[0].replace(/of\s+([\u00BF-\u1FFF\u2C00-\uD7FF\w]+)\s*$/, link);
}
if('tags' in sense) {
html += ' - '
html += sense.tags.map(tag => `<mark>${tag}</mark>`).join(', ')
}
html += '</li>';
})
html += '</ol>';