Small fixes
This commit is contained in:
parent
c5b0b930ec
commit
a458302388
|
@ -1,6 +1,6 @@
|
|||
use std::cmp;
|
||||
use std::iter::IntoIterator;
|
||||
use json::JsonValue::{Object, Short, Array};
|
||||
use json::JsonValue::{Object, Short};
|
||||
use json::JsonValue;
|
||||
|
||||
#[derive (Clone)]
|
||||
|
|
|
@ -38,3 +38,7 @@ h1, h2, h3 {
|
|||
body {
|
||||
font-family: serif;
|
||||
}
|
||||
|
||||
li {
|
||||
margin-top: .2em;
|
||||
}
|
||||
|
|
|
@ -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>';
|
||||
|
|
Loading…
Reference in New Issue