|
200 | 200 | function ContainerGroup(options) { |
201 | 201 | this.options = $.extend({}, groupDefaults, options) |
202 | 202 | this.containers = [] |
203 | | - this.scrollProxy = $.proxy(this.scroll, this) |
204 | | - this.dragProxy = $.proxy(this.drag, this) |
205 | | - this.dropProxy = $.proxy(this.drop, this) |
206 | 203 |
|
207 | 204 | if(!this.options.parentContainer){ |
| 205 | + this.scrollProxy = $.proxy(this.scroll, this) |
| 206 | + this.dragProxy = $.proxy(this.drag, this) |
| 207 | + this.dropProxy = $.proxy(this.drop, this) |
208 | 208 | this.placeholder = $(this.options.placeholder) |
| 209 | + |
209 | 210 | if(!options.isValidTarget) |
210 | 211 | this.options.isValidTarget = undefined |
211 | 212 | } |
|
400 | 401 | while(i--){ |
401 | 402 | this.containers[i].clearDimensions() |
402 | 403 | } |
| 404 | + }, |
| 405 | + destroy: function () { |
| 406 | + // TODO iterate over subgroups and destroy them |
| 407 | + // TODO remove all events |
| 408 | + containerGroups[this.options.group] = undefined |
403 | 409 | } |
404 | 410 | } |
405 | 411 |
|
|
519 | 525 | if(childContainers[0]){ |
520 | 526 | var options = $.extend({}, this.options, { |
521 | 527 | parentContainer: this, |
| 528 | + rootGroup: this.rootGroup, |
522 | 529 | group: groupCounter ++ |
523 | 530 | }) |
524 | 531 | childGroup = childContainers[pluginName](options).data(pluginName).group |
|
573 | 580 | }, |
574 | 581 | serialize: function () { |
575 | 582 | return this._serialize(this.el, true) |
| 583 | + }, |
| 584 | + destroy: function () { |
| 585 | + this.rootGroup.destroy() |
576 | 586 | } |
577 | 587 | } |
578 | 588 |
|
|
0 commit comments