Opened 13 years ago
Closed 10 years ago
#4781 closed feature (duplicate)
Patch: force draggable's containment property to update during drag
Reported by: | AJI | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 2.0.0 |
Component: | ui.draggable | Version: | 1.7.2 |
Keywords: | containment | Cc: | |
Blocked by: | Blocking: |
Description
The containment property for a draggable cannot be changed while the element is being dragged. This patch resets the containment during the drag.
Use case: a draggable element mimics a slider on a horizontal graph that can be stretched. When the draggable reaches one end of the graph, the graph widens. The slider is custom contained to the left half of the graph.
If the slider element widens the graph, its containment area will appear to shrink.
With this patch, client code can recalculate the containment area during the drag so that the containment area is maintained at half of the total width.
Patch for ui.draggable.js.
_mouseDrag: function(event, noPropagation) { /// PATCH START /// var o = this.options; //Set a containment if given in the options if (o.containment) this._setContainment(); //Recache the helper size this._cacheHelperProportions(); /// PATCH END /// //Compute the helpers position this.position = this._generatePosition(event); this.positionAbs = this._convertPositionTo("absolute");
Change History (6)
comment:1 Changed 13 years ago by
Milestone: | TBD → 1.8 |
---|
comment:2 Changed 11 years ago by
Type: | enhancement → feature |
---|
comment:3 Changed 10 years ago by
Milestone: | 1.9.0 → 2.0.0 |
---|
comment:4 Changed 10 years ago by
Status: | new → open |
---|
comment:6 Changed 10 years ago by
Resolution: | → duplicate |
---|---|
Status: | open → closed |
Duplicate of #4911.
We're not going to implement this as requested, but rather as part of the upcoming refresh()
method. Therefore, I'm closing as s duplicate.
Need to take this usecase into account for 2.0.0, not necessarily the solution.