From 8c37b0606031b57568cb31ea75e607b7fe4f8a02 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Mon, 7 Jan 2019 19:25:05 +0100 Subject: [PATCH] widget: fix geometry style update (properly apply 'auto') --- CHANGELOG.md | 5 +++++ src/client/app/widgets/common/widget.js | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09f34396..1571ceea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.41.2 + +- bug fixes + - geometry properties not properly applied when reset to `auto` + ## 0.41.1 - bug fixes diff --git a/src/client/app/widgets/common/widget.js b/src/client/app/widgets/common/widget.js index 6ec4bf42..87614304 100644 --- a/src/client/app/widgets/common/widget.js +++ b/src/client/app/widgets/common/widget.js @@ -780,11 +780,12 @@ class Widget extends EventEmitter { geometry = parseFloat(val) == val ? parseFloat(val)+'rem' : val } - if (geometry && geometry != 'auto') { + if (geometry) { + if (geometry === 'auto') geometry = '' this.container.style[d] = geometry - if (d == 'width') this.container.style.minWidth = geometry - if (d == 'height') this.container.style.minHeight = geometry - if (d == 'top' || d == 'left') this.container.classList.add('absolute-position') + if (d === 'width') this.container.style.minWidth = geometry + if (d === 'height') this.container.style.minHeight = geometry + if (d === 'top' || d === 'left') this.container.classList.add('absolute-position') } }