@ -81,7 +81,7 @@
componentDidMount : function ( ) {
componentDidMount : function ( ) {
var options = _extend ( _extend ( { } , _defaultOptions ) , this . sortableOptions || { } ) ,
var DOMNode , options = _extend ( _extend ( { } , _defaultOptions ) , this . sortableOptions || { } ) ,
copyOptions = _extend ( { } , options ) ,
copyOptions = _extend ( { } , options ) ,
emitEvent = function ( /** string */ type , /** Event */ evt ) {
emitEvent = function ( /** string */ type , /** Event */ evt ) {
@ -120,7 +120,11 @@
}
}
newState [ _getModelName ( this ) ] = items ;
newState [ _getModelName ( this ) ] = items ;
if ( copyOptions [ "stateHandler" ] ) {
this [ copyOptions [ "stateHandler" ] ] ( newState ) ;
} else {
this . setState ( newState ) ;
this . setState ( newState ) ;
}
( this !== _activeComponent ) && _activeComponent . setState ( remoteState ) ;
( this !== _activeComponent ) && _activeComponent . setState ( remoteState ) ;
}
}
@ -130,9 +134,10 @@
} . bind ( this ) ;
} . bind ( this ) ;
} , this ) ;
} , this ) ;
DOMNode = this . getDOMNode ( ) ? ( this . refs [ options . ref ] || this ) . getDOMNode ( ) : this . refs [ options . ref ] || this ;
/** @namespace this.refs — http://facebook.github.io/react/docs/more-about-refs.html */
/** @namespace this.refs — http://facebook.github.io/react/docs/more-about-refs.html */
this . _sortableInstance = Sortable . create ( ( this . refs [ options . ref ] || this ) . get DOMNode( ) , copyOptions ) ;
this . _sortableInstance = Sortable . create ( DOMNode , copyOptions ) ;
} ,
} ,
componentWillReceiveProps : function ( nextProps ) {
componentWillReceiveProps : function ( nextProps ) {