aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Bakaus <paul.bakaus@googlemail.com>2008-10-17 08:13:14 +0000
committerPaul Bakaus <paul.bakaus@googlemail.com>2008-10-17 08:13:14 +0000
commit25ad531eb4121d588d4d7f1a14c9c517ad1eeb21 (patch)
treeb2bee0fa2b2e0412328f7ed6c56b6dfeea6a629f
parent07e39a8d2e08e72811c9cd1fdb30f1553bba9de1 (diff)
downloadjquery-ui-25ad531eb4121d588d4d7f1a14c9c517ad1eeb21.tar.gz
jquery-ui-25ad531eb4121d588d4d7f1a14c9c517ad1eeb21.zip
sortable: fixed issue with first time append of the placeholder, now also the original classes are appended to the placeholder, with usually should give it the right size
-rw-r--r--ui/ui.sortable.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/ui/ui.sortable.js b/ui/ui.sortable.js
index 6c81c2e94..5fa9e4f3b 100644
--- a/ui/ui.sortable.js
+++ b/ui/ui.sortable.js
@@ -297,7 +297,10 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
var className = o.placeholder;
o.placeholder = {
element: function() {
- var el = $(document.createElement(self.currentItem[0].nodeName)).addClass(className || "ui-sortable-placeholder")[0];
+
+ var el = $(document.createElement(self.currentItem[0].nodeName))
+ .addClass(className || self.currentItem[0].className+" ui-sortable-placeholder")
+ .removeClass('ui-sortable-helper')[0];
if(!className) {
el.style.visibility = "hidden";
@@ -316,10 +319,15 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
};
}
- self.placeholder = $(o.placeholder.element.call(self.element, self.currentItem))
- self.currentItem.parent()[0].appendChild(self.placeholder[0]);
- self.placeholder[0].parentNode.insertBefore(self.placeholder[0], self.currentItem[0]);
+ //Create the placeholder
+ self.placeholder = $(o.placeholder.element.call(self.element, self.currentItem));
+
+ //Append it after the actual current item
+ self.currentItem.after(self.placeholder);
+
+ //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
o.placeholder.update(self, self.placeholder);
+
},
_contactContainers: function(e) {
@@ -442,7 +450,7 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
this.offsetParent = this.helper.offsetParent(); //Get the offsetParent and cache its position
var po = this.offsetParent.offset();
-
+
this.offsetParentBorders = {
top: (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
left: (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)