Permalink
Browse files

added the dragged object to the sortupdate event

  • Loading branch information...
Aaron Israel
Aaron Israel committed Apr 26, 2012
1 parent 176456d commit 39d3d78c3cb1e7c2a6f4649c6cf8c4ec01192c95
Showing with 3 additions and 3 deletions.
  1. +2 −2 README.md
  2. +1 −1 jquery.sortable.js
View
@@ -23,7 +23,7 @@ Use `.sortable-dragging` and `.sortable-placeholder` CSS selectors to change the
Use `sortupdate` event if you want to do something when the order changes (e.g. storing the new order):
``` javascript
-$('.sortable').sortable().bind('sortupdate', function() {
+$('.sortable').sortable().bind('sortupdate', function(e, draggedItem) {
//Triggered when the user stopped sorting and the DOM position has changed.
});
```
@@ -84,7 +84,7 @@ yepnope({
yep: 'jquery.sortable.js',
nope: 'jquery-ui.min.js',
complete: function() {
- $('.sortable').sortable().bind('sortupdate', function() {
+ $('.sortable').sortable().bind('sortupdate', function(e, draggedItem) {
//Store the new order.
}
}
View
@@ -46,7 +46,7 @@ $.fn.sortable = function(options) {
dragging.removeClass('sortable-dragging').fadeIn();
placeholders.detach();
if (index != dragging.index()) {
- items.parent().trigger('sortupdate');
+ items.parent().trigger('sortupdate', dragging);
}
dragging = null;
}).not('a[href], img').on('selectstart.h5s', function() {

0 comments on commit 39d3d78

Please sign in to comment.