diff options
author | Uri Gilad <antishok@gmail.com> | 2013-03-29 03:03:14 +0300 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2014-08-18 15:30:54 -0400 |
commit | 8eca7b8f45885d20c13f1bf64cad8bee5fc1d5c5 (patch) | |
tree | ef26fc139a50616d393f02bc44cd5a86042aa700 /ui | |
parent | 48ea2aadad11938cc5ddbd9a340c4ca1c997550d (diff) | |
download | jquery-ui-8eca7b8f45885d20c13f1bf64cad8bee5fc1d5c5.tar.gz jquery-ui-8eca7b8f45885d20c13f1bf64cad8bee5fc1d5c5.zip |
Draggable: Set explicit width/height instead of right/bottom css.
Fixes #7772
Diffstat (limited to 'ui')
-rw-r--r-- | ui/draggable.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ui/draggable.js b/ui/draggable.js index 68222b0d5..826098feb 100644 --- a/ui/draggable.js +++ b/ui/draggable.js @@ -220,6 +220,10 @@ $.widget("ui.draggable", $.ui.mouse, { $.ui.ddmanager.prepareOffsets(this, event); } + // Reset helper's right/bottom css if they're set and set explicit width/height instead + // as this prevents resizing of elements with right/bottom set (see #7772) + this._normalizeRightBottom(); + this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003) @@ -632,6 +636,17 @@ $.widget("ui.draggable", $.ui.mouse, { } }, + _normalizeRightBottom: function() { + if ( this.options.axis !== "y" && this.helper.css( "right" ) !== "auto" ) { + this.helper.width( this.helper.width() ); + this.helper.css( "right", "auto" ); + } + if ( this.options.axis !== "x" && this.helper.css( "bottom" ) !== "auto" ) { + this.helper.height( this.helper.height() ); + this.helper.css( "bottom", "auto" ); + } + }, + // From now on bulk stuff - mainly helpers _trigger: function( type, event, ui ) { |