File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ Use `.sortable-dragging` and `.sortable-placeholder` CSS selectors to change the
2323Use ` sortupdate ` event if you want to do something when the order changes (e.g. storing the new order):
2424
2525``` javascript
26- $ (' .sortable' ).sortable ().bind (' sortupdate' , function (e , draggedItem ) {
26+ $ (' .sortable' ).sortable ().bind (' sortupdate' , function (e , ui ) {
27+ // ui.item contains the current dragged element.
2728 // Triggered when the user stopped sorting and the DOM position has changed.
2829});
2930```
@@ -84,7 +85,7 @@ yepnope({
8485 yep: ' jquery.sortable.js' ,
8586 nope: ' jquery-ui.min.js' ,
8687 complete : function () {
87- $ (' .sortable' ).sortable ().bind (' sortupdate' , function (e , draggedItem ) {
88+ $ (' .sortable' ).sortable ().bind (' sortupdate' , function (e , ui ) {
8889 // Store the new order.
8990 }
9091 }
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ $.fn.sortable = function(options) {
4646 dragging . removeClass ( 'sortable-dragging' ) . fadeIn ( ) ;
4747 placeholders . detach ( ) ;
4848 if ( index != dragging . index ( ) ) {
49- items . parent ( ) . trigger ( 'sortupdate' , dragging ) ;
49+ items . parent ( ) . trigger ( 'sortupdate' , { item : dragging } ) ;
5050 }
5151 dragging = null ;
5252 } ) . not ( 'a[href], img' ) . on ( 'selectstart.h5s' , function ( ) {
You can’t perform that action at this time.
0 commit comments