|
64 | 64 | itemPath: "", |
65 | 65 | // The css selector of the items |
66 | 66 | itemSelector: "li", |
| 67 | + // The class given to "body" while an item is being dragged |
| 68 | + bodyClass: "dragging", |
| 69 | + // The class giving to an item while being dragged |
| 70 | + draggedClass: "dragged", |
| 71 | + // The class of the placeholder (must match placeholder option markup) |
| 72 | + placeholderClass: "placeholder", |
67 | 73 | // Check if the dragged item may be inside the container. |
68 | 74 | // Use with care, since the search for a valid container entails a depth first search |
69 | 75 | // and may be quite expensive. |
|
89 | 95 | height: $item.height(), |
90 | 96 | width: $item.width() |
91 | 97 | }) |
92 | | - $item.addClass("dragged") |
93 | | - $("body").addClass("dragging") |
| 98 | + $item.addClass(container.group.options.draggedClass) |
| 99 | + $("body").addClass(container.group.options.bodyClass) |
94 | 100 | }, |
95 | 101 | // Called when the mouse button is beeing released |
96 | 102 | onDrop: function ($item, container, _super, event) { |
97 | | - $item.removeClass("dragged").removeAttr("style") |
98 | | - $("body").removeClass("dragging") |
| 103 | + $item.removeClass(container.group.options.draggedClass).removeAttr("style") |
| 104 | + $("body").removeClass(container.group.options.bodyClass) |
99 | 105 | }, |
100 | 106 | // Called on mousedown. If falsy value is returned, the dragging will not start. |
101 | 107 | // If clicked on input element, ignore |
|
539 | 545 | }, |
540 | 546 | getItemDimensions: function () { |
541 | 547 | if(!this.itemDimensions){ |
542 | | - this.items = this.$getChildren(this.el, "item").filter(":not(.placeholder, .dragged)").get() |
| 548 | + this.items = this.$getChildren(this.el, "item").filter( |
| 549 | + ":not(." + this.group.options.placeholderClass + ", ." + this.group.options.draggedClass + ")" |
| 550 | + ).get() |
543 | 551 | setDimensions(this.items, this.itemDimensions = [], this.options.tolerance) |
544 | 552 | } |
545 | 553 | return this.itemDimensions |
|
0 commit comments