Merge pull request #1262 from ndom91/patch-1

Updated newsfeed.js - improved fullscreen iframe
This commit is contained in:
Michael Teeuw 2018-05-01 09:53:56 +02:00 committed by GitHub
commit ccb27c89d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -10,6 +10,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Enabled translation of feelsLike for module currentweather
- Added support for on-going calendar events
- Added scroll up in fullscreen newsfeed article view
- Changed fullscreen newsfeed width from 100% to 100vw (better results)
### Changed
- Use Electron 2 Beta. **Please test!**

View File

@ -180,10 +180,10 @@ Module.register("newsfeed",{
if (this.config.showFullArticle) {
var fullArticle = document.createElement("iframe");
fullArticle.className = "";
fullArticle.style.width = "100%";
fullArticle.style.width = "100vw";
// very large height value to allow scrolling
fullArticle.height = "10000";
fullArticle.style.height = "10000";
fullArticle.height = "3000";
fullArticle.style.height = "3000";
fullArticle.style.top = "0";
fullArticle.style.left = "0";
fullArticle.style.border = "none";
@ -378,6 +378,13 @@ Module.register("newsfeed",{
Log.info(this.name + " - showing " + this.config.showDescription ? "article description" : "full article");
this.updateDom(100);
}
} else if(notification == "ARTICLE_SCROLL_UP"){
if(this.config.showFullArticle == true){
this.scrollPosition -= this.config.scrollLength;
window.scrollTo(0, this.scrollPosition);
Log.info(this.name + " - scrolling up");
Log.info(this.name + " - ARTICLE_SCROLL_UP, scroll position: " + this.config.scrollLength);
}
} else if(notification == "ARTICLE_LESS_DETAILS"){
this.resetDescrOrFullArticleAndTimer();
Log.info(this.name + " - showing only article titles again");