Mercurial > addons > firefox-addons > feed-preview
diff js/feed-preview.js @ 29:688d75e554e0
Add option to expand feed entries by default
author | Guido Berhoerster <guido+feed-preview@berhoerster.name> |
---|---|
date | Mon, 21 Jan 2019 15:15:59 +0100 |
parents | f0c4a458869c |
children | 76e23b361e92 |
line wrap: on
line diff
--- a/js/feed-preview.js Mon Jan 21 08:22:52 2019 +0100 +++ b/js/feed-preview.js Mon Jan 21 15:15:59 2019 +0100 @@ -8,7 +8,8 @@ 'use strict'; -export function renderFeedPreview(feedPreviewDocument, feed) { +export function renderFeedPreview(feedPreviewDocument, feed, + expandEntriesByDefault) { // inject XSL stylesheet which transforms XHTML to HTML allowing the use of // the HTML DOM let xslFilename = browser.runtime.getURL('web_resources/xhtml-to-html.xsl'); @@ -59,9 +60,10 @@ let entryNode = feedPreviewDocument.importNode(entryTemplateElement.content, true); + entryNode.querySelector('details.entry').open = expandEntriesByDefault; + let titleElement; let titleNode; - if (typeof entry.link !== 'undefined') { titleNode = feedPreviewDocument .importNode(entryTitleLinkedTemplateElement.content, true);