@@ -1253,18 +1253,6 @@ return $.widget("ui.sortable", $.ui.mouse, {
12531253 }
12541254
12551255 this . dragging = false ;
1256- if ( this . cancelHelperRemoval ) {
1257- if ( ! noPropagation ) {
1258- this . _trigger ( "beforeStop" , event , this . _uiHash ( ) ) ;
1259- for ( i = 0 ; i < delayedTriggers . length ; i ++ ) {
1260- delayedTriggers [ i ] . call ( this , event ) ;
1261- } //Trigger all delayed events
1262- this . _trigger ( "stop" , event , this . _uiHash ( ) ) ;
1263- }
1264-
1265- this . fromOutside = false ;
1266- return false ;
1267- }
12681256
12691257 if ( ! noPropagation ) {
12701258 this . _trigger ( "beforeStop" , event , this . _uiHash ( ) ) ;
@@ -1273,10 +1261,12 @@ return $.widget("ui.sortable", $.ui.mouse, {
12731261 //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
12741262 this . placeholder [ 0 ] . parentNode . removeChild ( this . placeholder [ 0 ] ) ;
12751263
1276- if ( this . helper [ 0 ] !== this . currentItem [ 0 ] ) {
1277- this . helper . remove ( ) ;
1264+ if ( ! this . cancelHelperRemoval ) {
1265+ if ( this . helper [ 0 ] !== this . currentItem [ 0 ] ) {
1266+ this . helper . remove ( ) ;
1267+ }
1268+ this . helper = null ;
12781269 }
1279- this . helper = null ;
12801270
12811271 if ( ! noPropagation ) {
12821272 for ( i = 0 ; i < delayedTriggers . length ; i ++ ) {
@@ -1286,7 +1276,7 @@ return $.widget("ui.sortable", $.ui.mouse, {
12861276 }
12871277
12881278 this . fromOutside = false ;
1289- return true ;
1279+ return ! this . cancelHelperRemoval ;
12901280
12911281 } ,
12921282
0 commit comments