Fix undefined mobile search result attributes

This commit is contained in:
rainbowpigeon 2021-05-24 19:09:22 +08:00 committed by GitHub
parent 01f9e43e59
commit 65757a0f5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -919,8 +919,8 @@
if (results.length > 0) {
results.forEach(function (result) {
var item = document.createElement('a');
item.setAttribute('href', result.uri);
item.innerHTML = '<div class="mobile-search__item"><div class="mobile-search__item--title">📄 ' + result.title + '</div><div class="mobile-search__item--desc">' + (result.description ? result.description : result.content) + '</div></div>';
item.setAttribute('href', result.item.uri);
item.innerHTML = '<div class="mobile-search__item"><div class="mobile-search__item--title">📄 ' + result.item.title + '</div><div class="mobile-search__item--desc">' + (result.item.description ? result.item.description : result.item.content) + '</div></div>';
content.appendChild(item);
});
} else {