Hide News Feed loading option

Configuration option to hide News Feed module if feed is empty instead of showing LOADING status
This commit is contained in:
BeatIdo 2017-03-10 16:56:28 +01:00 committed by GitHub
parent d26d94b62a
commit 81aca500b3

View File

@ -21,6 +21,7 @@ Module.register("newsfeed",{
showSourceTitle: true,
showPublishDate: true,
showDescription: false,
hideLoading: false,
reloadInterval: 5 * 60 * 1000, // every 5 minutes
updateInterval: 10 * 1000,
animationSpeed: 2.5 * 1000,
@ -179,12 +180,18 @@ Module.register("newsfeed",{
fullArticle.src = this.newsItems[this.activeItem].url;
wrapper.appendChild(fullArticle);
}
if (this.config.hideLoading) {
this.show();
}
} else {
wrapper.innerHTML = this.translate("LOADING");
wrapper.className = "small dimmed";
if (this.config.hideLoading) {
this.hide();
} else {
wrapper.innerHTML = this.translate("LOADING");
wrapper.className = "small dimmed";
}
}
return wrapper;