Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions source/js/jquery-sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
itemPath: "",
// The css selector of the items
itemSelector: "li",
// Forces the placeholder height to that of the dragged item
forcePlaceholderSize: false,
// Check if the dragged item may be inside the container.
// Use with care, since the search for a valid container entails a depth first search
// and may be quite expensive.
Expand Down Expand Up @@ -262,6 +264,10 @@
this.options.onDragStart(this.item, this.itemContainer, groupDefaults.onDragStart, e)
this.item.before(this.placeholder)
this.dragging = true

if (this.options.forcePlaceholderSize && !this.placeholder.height()) {
this.placeholder.height(this.item.innerHeight() - parseInt(this.item.css('paddingTop') || 0, 10) - parseInt(this.item.css('paddingBottom') || 0, 10));
}
}

this.setPointer(e)
Expand Down Expand Up @@ -389,9 +395,9 @@
},
distanceMet: function (e) {
return (Math.max(
Math.abs(this.pointer.left - e.pageX),
Math.abs(this.pointer.top - e.pageY)
) >= this.options.distance)
Math.abs(this.pointer.left - e.pageX),
Math.abs(this.pointer.top - e.pageY)
) >= this.options.distance)
},
setupDelayTimer: function () {
var that = this
Expand Down