]> source.dussan.org Git - jquery-ui.git/commitdiff
Revert "Sortable: Always set placeholder size when necessary. Fixes #8262 - jQuery...
authorScott González <scott.gonzalez@gmail.com>
Mon, 30 Apr 2012 14:39:06 +0000 (10:39 -0400)
committerScott González <scott.gonzalez@gmail.com>
Mon, 30 Apr 2012 14:39:06 +0000 (10:39 -0400)
This reverts commit 4f19289c10e733a07cf60435c2e5df4ed2e23d37.

ui/jquery.ui.sortable.js

index 3378192c998de8ab8bdc92f2819d3379a5a72683..a6903b2631568f4804486b1280a8bfc14afe5b7b 100644 (file)
@@ -673,8 +673,9 @@ $.widget("ui.sortable", $.ui.mouse, {
                                        // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
                                        if(className && !o.forcePlaceholderSize) return;
 
-                                       p.height(self.currentItem.height());
-                                       p.width(self.currentItem.width());
+                                       //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item
+                                       if(!p.height()) { p.height(self.currentItem.innerHeight() - parseInt(self.currentItem.css('paddingTop')||0, 10) - parseInt(self.currentItem.css('paddingBottom')||0, 10)); };
+                                       if(!p.width()) { p.width(self.currentItem.innerWidth() - parseInt(self.currentItem.css('paddingLeft')||0, 10) - parseInt(self.currentItem.css('paddingRight')||0, 10)); };
                                }
                        };
                }