Opened 7 years ago

Closed 7 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 7 years ago by jzaefferer

  • Milestone changed from TBD to 1.7.2
  • Priority changed from minor to major

Consistency is important, and the original position can't be easily retrieved otherwise.

comment:2 Changed 7 years ago by jzaefferer

  • Milestone changed from 1.7.2 to 1.8

comment:3 Changed 7 years ago by paul

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r3119 for both draggable and sortable.

Note: See TracTickets for help on using tickets.