From 3462eb7f4be40cbd7dd4fd5762c099c1b9657d9b Mon Sep 17 00:00:00 2001 From: Nikos Katsikanis Date: Mon, 19 Mar 2018 17:57:51 +0000 Subject: [PATCH] updates --- README.md | 2 ++ src/SolarPopup.ts | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b711ce7..b280d0e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ + # Solar-popup diff --git a/src/SolarPopup.ts b/src/SolarPopup.ts index 9b053da..d4ed465 100644 --- a/src/SolarPopup.ts +++ b/src/SolarPopup.ts @@ -31,8 +31,12 @@ export default class SolarPopup implements IComponent { this.hostElement = tempElement.firstChild as HTMLElement this.hostElement.querySelector('.childContainer').appendChild(child) if (fixedDimensions) { - this.hostElement.style.width = `${fixedDimensions.width}px` - this.hostElement.style.height = `${fixedDimensions.height}px` + if (window.innerWidth > 2 * 10 + fixedDimensions.width) { + this.hostElement.style.width = `${fixedDimensions.width}px` + } + if (window.innerHeight > 2 * 10 + fixedDimensions.height) { + this.hostElement.style.height = `${fixedDimensions.height}px` + } } }