Search and Top Navigation
#4781 closed feature (duplicate)
Opened August 13, 2009 10:41PM UTC
Closed March 01, 2013 01:16PM UTC
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");
Attachments (0)
Change History (6)
Changed November 17, 2009 09:46AM UTC by comment:1
milestone: | TBD → 1.8 |
---|
Changed June 26, 2012 01:22AM UTC by comment:2
type: | enhancement → feature |
---|
Changed October 11, 2012 02:49PM UTC by comment:3
milestone: | 1.9.0 → 2.0.0 |
---|
Changed November 04, 2012 05:42PM UTC by comment:4
status: | new → open |
---|
Need to take this usecase into account for 2.0.0, not necessarily the solution.
Changed November 04, 2012 07:04PM UTC by comment:5
This should be handled by refresh()
.