Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added the dragged object to the sortupdate event

  • Loading branch information...
commit 39d3d78c3cb1e7c2a6f4649c6cf8c4ec01192c95 1 parent 176456d
Aaron Israel authored
Showing with 3 additions and 3 deletions.
  1. +2 −2 README.md
  2. +1 −1  jquery.sortable.js
View
4 README.md
@@ -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
2  jquery.sortable.js
@@ -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() {
Please sign in to comment.
Something went wrong with that request. Please try again.