diff --git a/static/skin/index.js b/static/skin/index.js index 413aad469..223982f84 100644 --- a/static/skin/index.js +++ b/static/skin/index.js @@ -67,7 +67,8 @@ } function getInnerHtml(node, query) { - return node.querySelector(query).innerHTML; + const queryNode = node.querySelector(query); + return queryNode != null ? queryNode.innerHTML : ""; } function generateBookHtml(book, sort = false) { @@ -103,6 +104,7 @@ if (sort) { divTag.setAttribute('data-idx', bookOrderMap.get(id)); } + const languageAttr = language != '' ? '' : 'style="background-color: transparent"'; divTag.innerHTML = `
@@ -111,7 +113,7 @@ ${downloadLink ? `
Download ${humanFriendlyZimSize ? ` - ${humanFriendlyZimSize}
`: ''}` : ''}
${description}
-
${language.substr(0, 2).toUpperCase()}
+
${language.substr(0, 2).toUpperCase()}
${tagHtml}
`; return divTag;