Skip to content
Permalink
Browse files
Sortable: Always set placeholder size when necessary. Fixes #8262 - j…
…Query UI 1.8.19 don't respect forcePlaceholderSize.
  • Loading branch information
bertterheide authored and scottgonzalez committed Apr 19, 2012
1 parent d0cac09 commit 4f19289
Showing 1 changed file with 2 additions and 3 deletions.
@@ -673,9 +673,8 @@ $.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;

//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)); };
p.height(self.currentItem.height());
p.width(self.currentItem.width());
}
};
}

1 comment on commit 4f19289

@bertterheide
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can make it a one-liner:

p.height(self.currentItem.height()).width(self.currentItem.width());

Please sign in to comment.