aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src
diff options
context:
space:
mode:
Diffstat (limited to 'juick-www/src')
-rw-r--r--juick-www/src/main/js/killy/index.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/juick-www/src/main/js/killy/index.js b/juick-www/src/main/js/killy/index.js
index 1a59805dc..46798c9f6 100644
--- a/juick-www/src/main/js/killy/index.js
+++ b/juick-www/src/main/js/killy/index.js
@@ -40,9 +40,13 @@ function makeResizableToRatio(element, ratio) {
// calcHeight :: Number -> Number -- calculate element height for a given width
function makeResizable(element, calcHeight) {
- const resizeToRatio = el => { el.style.height = (calcHeight(el.offsetWidth)).toFixed(2) + 'px'; };
- window.addEventListener('resize', () => resizeToRatio(element));
- resizeToRatio(element);
+ const setHeight = el => {
+ if (el.offsetWidth > 0) {
+ el.style.height = (calcHeight(el.offsetWidth)).toFixed(2) + 'px';
+ }
+ };
+ window.addEventListener('resize', () => setHeight(element));
+ setHeight(element);
}
function getEmbeddableLinkTypes() {