r3107 committed - draggable: scope option failed when no droppables within that scope ex...

r3107 committed - draggable: scope option failed when no droppables within that scope ex...


Revision: 3107
Author: paul.bakaus
Date: Sat Aug 22 04:48:48 2009
Log: draggable: scope option failed when no droppables within that scope
exist, fixes #4289
http://code.google.com/p/jquery-ui/source/detail?r=3107
Modified:
/trunk/ui/ui.droppable.js
=======================================
--- /trunk/ui/ui.droppable.js    Wed Jul 8 20:16:23 2009
+++ /trunk/ui/ui.droppable.js    Sat Aug 22 04:48:48 2009
@@ -197,7 +197,7 @@
    droppables: { 'default': [] },
    prepareOffsets: function(t, event) {
-        var m = $.ui.ddmanager.droppables[t.options.scope];
+        var m = $.ui.ddmanager.droppables[t.options.scope] || [];
        var type = event ? event.type : null; // workaround for #2317
        var list = (t.currentItem ||
t.element).find(":data(droppable)").andSelf();
@@ -218,7 +218,7 @@
    drop: function(draggable, event) {
        var dropped = false;
-        $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
+        $.each($.ui.ddmanager.droppables[draggable.options.scope] || [],
function() {
            if(!this.options) return;
            if (!this.options.disabled && this.visible && $.ui.intersect(draggable,
this, this.options.tolerance))
@@ -240,7 +240,7 @@
        //Run through all droppables and check their positions based on specific
tolerance options
-        $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
+        $.each($.ui.ddmanager.droppables[draggable.options.scope] || [],
function() {
            if(this.options.disabled || this.greedyChild || !this.visible) return;
            var intersects = $.ui.intersect(draggable, this,
this.options.tolerance);