From a8fbace82b12859596765a875134fe1b55e7374c Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 7 Feb 2018 08:49:49 +0100 Subject: [PATCH] Update the resizer in conjunction with panels --- src/panels/view/PanelView.js | 3 ++- src/utils/Resizer.js | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/panels/view/PanelView.js b/src/panels/view/PanelView.js index b0b1b96aa..fd80a2f9f 100644 --- a/src/panels/view/PanelView.js +++ b/src/panels/view/PanelView.js @@ -77,7 +77,8 @@ module.exports = Backbone.View.extend({ width: rect.width, height: rect.height }; - } + }, + ...resizable }); resizer.blur = () => {}; resizer.focus(this.el); diff --git a/src/utils/Resizer.js b/src/utils/Resizer.js index 327d204ae..e3ce41ab8 100644 --- a/src/utils/Resizer.js +++ b/src/utils/Resizer.js @@ -321,7 +321,7 @@ class Resizer { const conStyle = this.container.style; const updateTarget = this.updateTarget; const selectedHandler = this.getSelectedHandler(); - const { unitHeight, unitWidth } = config; + const { unitHeight, unitWidth, keyWidth, keyHeight } = config; // Use custom updating strategy if requested if (isFunction(updateTarget)) { @@ -333,8 +333,8 @@ class Resizer { }); } else { const elStyle = el.style; - elStyle.width = rect.w + unitWidth; - elStyle.height = rect.h + unitHeight; + elStyle[keyWidth] = rect.w + unitWidth; + elStyle[keyHeight] = rect.h + unitHeight; } const unitRect = 'px';