Opened 14 years ago
Closed 14 years ago
#3782 closed enhancement (fixed)
ui object should retrieve original position also
Reported by: | 4pcbr | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.8 |
Component: | ui.draggable | Version: | 1.6rc4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Resizable callbacks returns ui.size and ui.originalSize, i.e. user can get both original and actual sizes while only stop callback is called.
But if I wanna know original position of draggable element after it dragged, i should to remember its original position in start callback, and then get remembered original position object in a stop callback.
I think it is inconvenient, I need to remember original object somewhere and to define start callback for this purpose only(if not defined earlier : )).
Here is my uiHash modification:
uiHash: function(e) {
return {
helper: this.helper,
position: this.position,
absolutePosition: this.positionAbs,
originalPosition: this.originalPosition,
absoluteOriginalPosition: this.originalPositionAbs,
options: this.options
}
}
originalPositionAbs is defined in mouseStart(e) method:
this.originalPosition = this.generatePosition(e);
this.originalPositionAbs = this.convertPositionTo("absolute", this.originalPosition);
Change History (3)
comment:1 Changed 14 years ago by
Milestone: | TBD → 1.7.2 |
---|---|
Priority: | minor → major |
comment:2 Changed 14 years ago by
Milestone: | 1.7.2 → 1.8 |
---|
comment:3 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in r3119 for both draggable and sortable.
Consistency is important, and the original position can't be easily retrieved otherwise.