From 32e255c2f0e993a99411af11c1cde8a273593090 Mon Sep 17 00:00:00 2001 From: Jens Date: Sat, 3 Sep 2016 19:45:05 +0200 Subject: [PATCH] added ability for users to change image dimensions --- MMM-Instagram.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/MMM-Instagram.js b/MMM-Instagram.js index d99f336..9d83197 100644 --- a/MMM-Instagram.js +++ b/MMM-Instagram.js @@ -18,6 +18,8 @@ Module.register('MMM-Instagram', { access_token: '', count: 200, min_timestamp: 0, + instaMaxWidth: '100%', + instaMaxHeight: '100%', loadingText: 'Loading...' }, @@ -77,12 +79,15 @@ Module.register('MMM-Instagram', { var tempimage = this.images.photo[this.activeItem]; // image - var imageLink = document.createElement('div'); //imageLink.innerHTML = ""; - imageLink.id = "MMM-Instagram-image"; - imageLink.innerHTML = ""; + + var imageWrapper = document.createElement("img"); + imageWrapper.src = tempimpage.photolink; + imageWrapper.id = "MMM-Instagram-image" + imageWrapper.style.maxWidth = this.config.instaMaxWidth; + imageWrapper.style.maxHeight = this.config.instaMaxHeight; + imageDisplay.appendChild(imageWrapper); - imageDisplay.appendChild(imageLink); wrapper.appendChild(imageDisplay); return wrapper;