aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-04-30 10:39:06 -0400
committerScott González <scott.gonzalez@gmail.com>2012-04-30 10:52:53 -0400
commit3752211565ac034d535ad72c9f094cc644575aae (patch)
treeb1461446745a7480256224fd03c73aa601517408 /ui
parent42041f8387298c48228d0cc99f48d2d5521e8cbb (diff)
downloadjquery-ui-3752211565ac034d535ad72c9f094cc644575aae.tar.gz
jquery-ui-3752211565ac034d535ad72c9f094cc644575aae.zip
Revert "Sortable: Always set placeholder size when necessary. Fixes #8262 - jQuery UI 1.8.19 don't respect forcePlaceholderSize."
This reverts commit 4f19289c10e733a07cf60435c2e5df4ed2e23d37. (cherry picked from commit 21df5c27e312c6e5fda66e602abefa51c484d676)
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.sortable.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js
index 14601376e..8a0941f9b 100644
--- a/ui/jquery.ui.sortable.js
+++ b/ui/jquery.ui.sortable.js
@@ -674,8 +674,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)); };
}
};
}