Skip to content

Commit

Permalink
feat(draggable): pass previous position to the drag callback
Browse files Browse the repository at this point in the history
  • Loading branch information
vieron committed Oct 26, 2013
1 parent 91ca657 commit 055cc0e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/jquery.draggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,14 @@
'top' : offset.top
});

var last_position = this.last_position || data.position;
data.prev_position = last_position;

if (this.options.drag) {
this.options.drag.call(this.$player, e, data);
}

this.last_position = data.position;
return false;
};

Expand Down

0 comments on commit 055cc0e

Please sign in to comment.