Droppable: "accept" option now takes function

This commit is contained in:
Dave Stein 2013-02-18 17:50:39 -05:00
parent b329fb891d
commit e056860f5d

View File

@ -64,7 +64,12 @@ $.widget( "ui.droppable", {
/** internal **/
_start: function( event ) {
if ( this.options.accept && !$( event.target ).is( this.options.accept ) ) {
if ( typeof this.options.accept === 'function' ) {
if ( this.options.accept.call( this.element, event.target ) !== true ) {
return false;
}
}
else if ( this.options.accept && !$( event.target ).is( this.options.accept ) ) {
return false;
}