# HG changeset patch # User Guido Berhoerster # Date 1543331114 -3600 # Node ID fcd65cf3f634b53307731ba00eb387f4024fcec4 # Parent c271192aac9d36980df301e8b7adb8575d1c39d2 Simplify the hint shown if there are no entries Always create the element and hide it with CSS if there are entries. diff -r c271192aac9d -r fcd65cf3f634 js/feed-preview.js --- a/js/feed-preview.js Tue Nov 27 11:11:15 2018 +0100 +++ b/js/feed-preview.js Tue Nov 27 16:05:14 2018 +0100 @@ -36,6 +36,9 @@ feedPreviewDocument.querySelector('#feed-header').prepend(logoNode); } + feedPreviewDocument.querySelector("#no-entries-hint").textContent = + browser.i18n.getMessage('noEntriesHint'); + let entryTemplateElement = feedPreviewDocument.querySelector('#entry-template'); let entryTitleTemplateElement = @@ -46,16 +49,6 @@ feedPreviewDocument.querySelector('#entry-files-list-template'); let entryFileTemplateElement = feedPreviewDocument.querySelector('#entry-file-template'); - if (feed.entries.length === 0) { - let hintTemplateElement = - previewDocument.querySelector('#no-entries-hint-template'); - let hintNode = previewDocument.importNode(hintTemplateElement.content, - true); - hintNode.querySelector("#no-entries-hint").textContent = - browser.i18n.getMessage('noEntriesHint'); - - previewDocument.body.append(hintNode); - } for (let entry of feed.entries) { let entryNode = feedPreviewDocument.importNode(entryTemplateElement.content, diff -r c271192aac9d -r fcd65cf3f634 web_resources/feed-preview.xhtml --- a/web_resources/feed-preview.xhtml Tue Nov 27 11:11:15 2018 +0100 +++ b/web_resources/feed-preview.xhtml Tue Nov 27 16:05:14 2018 +0100 @@ -44,9 +44,6 @@ -