From 37d61b35d06d0c080cafb29e0e4ca9b2533e38a2 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Wed, 28 Dec 2016 19:28:59 -0800 Subject: fix glossary lists with one item --- ext/bg/js/yomichan.js | 12 ++++++++---- ext/fg/css/frame.css | 8 ++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'ext') diff --git a/ext/bg/js/yomichan.js b/ext/bg/js/yomichan.js index e8956057..6cb7d415 100644 --- a/ext/bg/js/yomichan.js +++ b/ext/bg/js/yomichan.js @@ -161,11 +161,15 @@ class Yomichan { break; case 'glossary-list': if (definition.glossary) { - value = '
    '; - for (const gloss of definition.glossary) { - value += `
  1. ${gloss}
  2. `; + if (definition.glossary.length > 1) { + value = '
      '; + for (const gloss of definition.glossary) { + value += `
    1. ${gloss}
    2. `; + } + value += '
    '; + } else { + value = `

    ${definition.glossary.join('')}

    `; } - value += '
'; } break; case 'tags': diff --git a/ext/fg/css/frame.css b/ext/fg/css/frame.css index d519d4b7..8b8172f7 100644 --- a/ext/fg/css/frame.css +++ b/ext/fg/css/frame.css @@ -114,7 +114,9 @@ body { } .term-glossary li span { - color: #000; + color: #000; + overflow-x: auto; + white-space: pre; } .term-glossary p { @@ -156,7 +158,9 @@ body { } .kanji-glossary li span { - color: #000; + color: #000; + overflow-x: auto; + white-space: pre; } .kanji-glossary p { -- cgit v1.2.3