Browse Source

Hide feed-title in combined mode in single feed

With the recent switch to JS templates, the feed_title was always
printed in the headline even if it was empty. With this change it is
only printed if it is acutally defined.
Michael Guntsche 1 year ago
parent
commit
dbd247ec3d
1 changed files with 14 additions and 7 deletions
  1. 14 7
      js/Headlines.js

+ 14 - 7
js/Headlines.js

@@ -289,12 +289,19 @@ define(["dojo/_base/declare"], function (declare) {
 									<span class="HLLCTR-${hl.id}">${hl.labels}</span>
 									${hl.cdm_excerpt ? hl.cdm_excerpt : ""}
 								</span>
-								
-								<div class="feed">
-									<a href="#" style="background-color: rgba(${hl.favicon_avg_color_rgba})" 
-										onclick="Feeds.open({feed:${hl.feed_id}})">${hl.feed_title}</a>
-								</div>
-								
+
+							${
+								(feed_title => {
+									if(feed_title) {
+										return `<div class="feed"> <a href="#" style="background-color:
+										rgba(${hl.favicon_avg_color_rgba})" onclick="Feeds.open({feed:${hl.feed_id}})">${hl.feed_title}</a> </div>`
+									}
+									else {
+										return "";
+									}
+								})(hl.feed_title)
+							}
+	
 								<span class="updated" title="${hl.imported}">${hl.updated}</span>
 								
 								<div class="right">                        
@@ -1378,4 +1385,4 @@ define(["dojo/_base/declare"], function (declare) {
 	}
 
 	return Headlines;
-});
+});