From 7fad36c19492747576371ea534bc323c51ea2e60 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Mon, 7 Jan 2019 22:59:09 +0100 Subject: [PATCH] strip: regression from dynamic editing: handle geometry coerce differently to avoid layout bugs --- CHANGELOG.md | 3 ++- src/client/app/editor/index.js | 7 ++++++- src/client/app/widgets/common/widget.js | 7 ------- src/scss/widgets/panel.scss | 5 +++++ 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1571ceea..a21dd633 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,8 @@ ## 0.41.2 - bug fixes - - geometry properties not properly applied when reset to `auto` + - geometry properties not properly applied when reset to `auto` + - `strip` layout not properly applied when changing the widget's `horizontal` property ## 0.41.1 diff --git a/src/client/app/editor/index.js b/src/client/app/editor/index.js index 2067dc9f..7c89c5be 100644 --- a/src/client/app/editor/index.js +++ b/src/client/app/editor/index.js @@ -421,6 +421,11 @@ var Editor = class Editor { } else { + if (widget.parent !== widgetManager && widget.parent.getProp('type') === 'strip') { + // special case for widgets in strips + if (propName === 'top' || propName === 'left' || propName === (widget.parent.getProp('horizontal') ? 'height' : 'width')) continue + } + field = editField(this, widget, propName, props[propName]) if (!field) continue @@ -474,7 +479,7 @@ var Editor = class Editor { } - if (widget.props.top !== undefined) { + if (widget.props.top !== undefined && widget.parent.getProp('type') !== 'strip') { let $container = $(widget.container) $container.draggable({ cursor:'-webkit-grabbing', diff --git a/src/client/app/widgets/common/widget.js b/src/client/app/widgets/common/widget.js index 5c2b0167..629818af 100644 --- a/src/client/app/widgets/common/widget.js +++ b/src/client/app/widgets/common/widget.js @@ -142,13 +142,6 @@ class Widget extends EventEmitter { this.children = [] this.reCreateOptions = options.reCreateOptions - // strip parent ? no position - if (this.parent && this.parent.props && this.parent.props.type == 'strip') { - delete this.props.top - delete this.props.left - delete this.props[this.parent.getProp('horizontal') ? 'height' : 'width'] - } - this.createPropsCache() if (this.getProp('id') == 'root' && !options.root) { diff --git a/src/scss/widgets/panel.scss b/src/scss/widgets/panel.scss index d1ef6845..a4df6657 100644 --- a/src/scss/widgets/panel.scss +++ b/src/scss/widgets/panel.scss @@ -128,6 +128,11 @@ > .panel { --spacing: 0; + > .widget { + top:auto!important; + left:auto!important; + position: relative!important; + } } &.vertical {