From e056860f5db30fb633e7de6e92a140100f77191a Mon Sep 17 00:00:00 2001 From: Dave Stein Date: Mon, 18 Feb 2013 17:50:39 -0500 Subject: [PATCH] Droppable: "accept" option now takes function --- ui/jquery.ui.droppable.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/jquery.ui.droppable.js b/ui/jquery.ui.droppable.js index 08654aaa0..7ee899820 100644 --- a/ui/jquery.ui.droppable.js +++ b/ui/jquery.ui.droppable.js @@ -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; }