r2209 - trunk/ui
r2209 - trunk/ui
Author: cloudream@gmail.com
Date: Thu Mar 5 10:18:49 2009
New Revision: 2209
Modified:
trunk/ui/ui.droppable.js
Log:
Droppable: short _init code.
Modified: trunk/ui/ui.droppable.js
==============================================================================
--- trunk/ui/ui.droppable.js (original)
+++ trunk/ui/ui.droppable.js Thu Mar 5 10:18:49 2009
@@ -20,7 +20,7 @@
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 @@
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"));
},