Fix tag double click

This commit is contained in:
toasted-nutbread 2020-01-29 19:52:24 -05:00
parent 05bb4aef71
commit dd700af0be
3 changed files with 11 additions and 5 deletions

View File

@ -208,17 +208,21 @@ button.action-button {
}
.tag {
display: inline;
display: inline-block;
padding: 0.2em 0.6em 0.3em;
font-size: 75%;
font-weight: 700;
line-height: 1;
line-height: 1.25;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: 0.25em;
}
.tag-inner {
display: block;
}
.tag-list>.tag+.tag {
margin-left: 0.375em;
}

View File

@ -75,7 +75,7 @@
<template id="kanji-glossary-item-template"><li class="kanji-glossary-item"><span class="kanji-glossary"></span></li></template>
<template id="kanji-reading-template"><dd class="kanji-reading"></dd></template>
<template id="tag-template"><span class="tag"></span></template>
<template id="tag-frequency-template"><span class="tag" data-category="frequency"><span class="term-frequency-dictionary-name"></span><span class="term-frequency-separator"></span><span class="term-frequency-value"></span></template>
<template id="tag-template"><span class="tag"><span class="tag-inner"></span></span></template>
<template id="tag-frequency-template"><span class="tag" data-category="frequency"><span class="tag-inner"><span class="term-frequency-dictionary-name"></span><span class="term-frequency-separator"></span><span class="term-frequency-value"></span></span></template>
</body></html>

View File

@ -252,8 +252,10 @@ class DisplayGenerator {
createTag(details) {
const node = DisplayGenerator._instantiateTemplate(this._tagTemplate);
const inner = node.querySelector('.tag-inner');
node.title = details.notes;
node.textContent = details.name;
inner.textContent = details.name;
node.dataset.category = details.category;
return node;