diff options
author | Chi Cheng <cloudream@gmail.com> | 2009-03-05 18:18:49 +0000 |
---|---|---|
committer | Chi Cheng <cloudream@gmail.com> | 2009-03-05 18:18:49 +0000 |
commit | 7e8ea7a36a14167a371d8a1df31503c95fa3e855 (patch) | |
tree | 4c31986da82d266ebb352ec44869f72664184fe3 | |
parent | 73163f471ea970f5f8f473d521408a3375f0e866 (diff) | |
download | jquery-ui-7e8ea7a36a14167a371d8a1df31503c95fa3e855.tar.gz jquery-ui-7e8ea7a36a14167a371d8a1df31503c95fa3e855.zip |
Droppable: short _init code.
-rw-r--r-- | ui/ui.droppable.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/ui.droppable.js b/ui/ui.droppable.js index 8d53273f8..e4c187c26 100644 --- a/ui/ui.droppable.js +++ b/ui/ui.droppable.js @@ -20,7 +20,7 @@ $.widget("ui.droppable", { var o = this.options, accept = o.accept; this.isover = 0; this.isout = 1; - this.options.accept = this.options.accept && $.isFunction(this.options.accept) ? this.options.accept : function(d) { + this.options.accept = accept && $.isFunction(accept) ? accept : function(d) { return d.is(accept); }; @@ -28,10 +28,10 @@ $.widget("ui.droppable", { this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight }; // Add the reference and positions to the manager - $.ui.ddmanager.droppables[this.options.scope] = $.ui.ddmanager.droppables[this.options.scope] || []; - $.ui.ddmanager.droppables[this.options.scope].push(this); + $.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || []; + $.ui.ddmanager.droppables[o.scope].push(this); - (this.options.addClasses && this.element.addClass("ui-droppable")); + (o.addClasses && this.element.addClass("ui-droppable")); }, |