From 6ed4d4389cf040762066b5ffe2af0baa75325ef2 Mon Sep 17 00:00:00 2001 From: Ilan Date: Thu, 19 Feb 2015 13:39:14 +0200 Subject: [PATCH 1/2] Fixes 11135 - resizeable issue with border-box If you apply .resizeable() to an element which has border-box sizing and this element has a border then the container will "shrink" by this border size immediately as the resizing drag begins. --- ui/resizable.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ui/resizable.js b/ui/resizable.js index c167508b397..054293aecb8 100644 --- a/ui/resizable.js +++ b/ui/resizable.js @@ -487,15 +487,18 @@ $.widget("ui.resizable", $.ui.mouse, { if ( this.position.left !== this.prevPosition.left ) { props.left = this.position.left + "px"; } - if ( this.size.width !== this.prevSize.width ) { - props.width = this.size.width + "px"; - } - if ( this.size.height !== this.prevSize.height ) { - props.height = this.size.height + "px"; - } this.helper.css( props ); + if (this.size.width !== this.prevSize.width) { + props.width = this.size.width + "px"; + this.helper.width(this.size.width); + } + if (this.size.height !== this.prevSize.height) { + props.height = this.size.height + "px"; + this.helper.height(this.size.height); + } + return props; }, From 9fa0867675367144ab42645c0f4ba6ebcf449f82 Mon Sep 17 00:00:00 2001 From: Ilan Date: Thu, 19 Feb 2015 15:43:20 +0200 Subject: [PATCH 2/2] Fixes 10948 and 8932 alsoResize with border-box sizing --- ui/resizable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/resizable.js b/ui/resizable.js index 054293aecb8..1d0aada976a 100644 --- a/ui/resizable.js +++ b/ui/resizable.js @@ -997,8 +997,8 @@ $.ui.plugin.add("resizable", "alsoResize", { $(exp).each(function() { var el = $(this); el.data("ui-resizable-alsoresize", { - width: parseInt(el.width(), 10), height: parseInt(el.height(), 10), - left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10) + width: parseInt(el.css("width"), 10), height: parseInt(el.css("height"), 10), + left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10) }); }); };