diff options
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 ) { |