|
45 | 45 | }, // end container defaults |
46 | 46 | groupDefaults = { |
47 | 47 | // This is executed after the placeholder has been moved. |
48 | | - afterMove: function ($placeholder, container) { |
| 48 | + // $closestItemOrContainer contains the closest item, the placeholder |
| 49 | + // has been put at or the closest empty Container, the placeholder has |
| 50 | + // been appended to. |
| 51 | + afterMove: function ($placeholder, container, $closestItemOrContainer) { |
49 | 52 | }, |
50 | 53 | // The exact css path between the container and its items, e.g. "> tbody" |
51 | 54 | containerPath: "", |
|
112 | 115 | // Note that this default method only works, if every item only has one subcontainer |
113 | 116 | serialize: function ($parent, $children, parentIsContainer) { |
114 | 117 | var result = $.extend({}, $parent.data()) |
115 | | - |
| 118 | + |
116 | 119 | if(parentIsContainer) |
117 | 120 | return $children |
118 | 121 | else if ($children[0]){ |
|
210 | 213 | this.dragProxy = $.proxy(this.drag, this) |
211 | 214 | this.dropProxy = $.proxy(this.drop, this) |
212 | 215 | this.placeholder = $(this.options.placeholder) |
213 | | - |
| 216 | + |
214 | 217 | if(!options.isValidTarget) |
215 | 218 | this.options.isValidTarget = undefined |
216 | 219 | } |
|
331 | 334 | item[method](this.placeholder) |
332 | 335 | this.lastAppendedItem = item |
333 | 336 | this.sameResultBox = sameResultBox |
334 | | - this.options.afterMove(this.placeholder, container) |
| 337 | + this.options.afterMove(this.placeholder, container, item) |
335 | 338 | }, |
336 | 339 | getContainerDimensions: function () { |
337 | 340 | if(!this.containerDimensions) |
|
358 | 361 | } |
359 | 362 | } |
360 | 363 | } |
361 | | - |
| 364 | + |
362 | 365 | this.offsetParent = offsetParent |
363 | 366 | } |
364 | 367 | return this.offsetParent |
|
562 | 565 | _serialize: function (parent, isContainer) { |
563 | 566 | var that = this, |
564 | 567 | childType = isContainer ? "item" : "container", |
565 | | - |
| 568 | + |
566 | 569 | children = this.$getChildren(parent, childType).not(this.options.exclude).map(function () { |
567 | 570 | return that._serialize($(this), !isContainer) |
568 | 571 | }).get() |
569 | | - |
| 572 | + |
570 | 573 | return this.rootGroup.options.serialize(parent, children, isContainer) |
571 | 574 | }, |
572 | 575 | clearDimensions: function () { |
|
598 | 601 | } |
599 | 602 |
|
600 | 603 | $.extend(Container.prototype, API) |
601 | | - |
| 604 | + |
602 | 605 | /** |
603 | 606 | * jQuery API |
604 | 607 | * |
|
0 commit comments