From 0176e3d266898f6c8d768c11dd4a552529c6a6b8 Mon Sep 17 00:00:00 2001 From: Takayama Fumihiko Date: Sat, 23 May 2020 21:36:38 +0900 Subject: [PATCH] Update offline search result design --- assets/js/offline-search.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/assets/js/offline-search.js b/assets/js/offline-search.js index 9fb5afea3b..a24a5f86cb 100644 --- a/assets/js/offline-search.js +++ b/assets/js/offline-search.js @@ -143,27 +143,30 @@ ); } else { results.forEach((r) => { - const $cardHeader = $('
').addClass('card-header'); const doc = resultDetails.get(r.ref); const href = $searchInput.data('offline-search-base-href') + r.ref.replace(/^\//, ''); - $cardHeader.append( - $('').attr('href', href).text(doc.title) + const $entry = $('
').addClass('mt-4'); + + $entry.append( + $('').addClass('d-block text-muted').text(r.ref) ); - const $cardBody = $('
').addClass('card-body'); - $cardBody.append( - $('

') - .addClass('card-text text-muted') - .text(doc.excerpt) + $entry.append( + $('') + .addClass('d-block') + .css({ + fontSize: '1.2rem', + }) + .attr('href', href) + .text(doc.title) ); - const $card = $('