mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Droppable: "accept" option now takes function
This commit is contained in:
parent
b329fb891d
commit
e056860f5d
7
ui/jquery.ui.droppable.js
vendored
7
ui/jquery.ui.droppable.js
vendored
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user