mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
use $.isFunction instead of checking the constructor
This commit is contained in:
parent
aed298125d
commit
dc31bc2f3e
@ -18,7 +18,7 @@ $.widget("ui.droppable", {
|
|||||||
_setData: function(key, value) {
|
_setData: function(key, value) {
|
||||||
|
|
||||||
if(key == 'accept') {
|
if(key == 'accept') {
|
||||||
this.options.accept = value && value.constructor == Function ? value : function(d) {
|
this.options.accept = value && $.isFunction(value) ? value : function(d) {
|
||||||
return d.is(accept);
|
return d.is(accept);
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
@ -32,7 +32,7 @@ $.widget("ui.droppable", {
|
|||||||
var o = this.options, accept = o.accept;
|
var o = this.options, accept = o.accept;
|
||||||
this.isover = 0; this.isout = 1;
|
this.isover = 0; this.isout = 1;
|
||||||
|
|
||||||
this.options.accept = this.options.accept && this.options.accept.constructor == Function ? this.options.accept : function(d) {
|
this.options.accept = this.options.accept && $.isFunction(this.options.accept) ? this.options.accept : function(d) {
|
||||||
return d.is(accept);
|
return d.is(accept);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user