]> source.dussan.org Git - jquery-ui.git/commitdiff
Droppable: greedy children now consider only parents with same scope as parents....
authorPhilipp Benjamin Köppchen <xgxtpbk@gws.ms>
Mon, 27 Aug 2012 18:37:04 +0000 (20:37 +0200)
committerScott González <scott.gonzalez@gmail.com>
Wed, 29 Aug 2012 12:24:14 +0000 (08:24 -0400)
ui/jquery.ui.droppable.js

index 36179d6d5e6e6eb8ab4d18712d5c56bf422ee13c..a99ec50a3aa1d7571844e5d76175bb66f1513040 100644 (file)
@@ -253,7 +253,12 @@ $.ui.ddmanager = {
 
                        var parentInstance;
                        if (this.options.greedy) {
-                               var parent = this.element.parents(':data(droppable):eq(0)');
+                               // find droppable parents with same scope
+                               var scope = this.options.scope;
+                               var parent = this.element.parents(':data(droppable)').filter(function () {
+                                       return $.data(this, 'droppable').options.scope === scope;
+                               });
+
                                if (parent.length) {
                                        parentInstance = $.data(parent[0], 'droppable');
                                        parentInstance.greedyChild = (c == 'isover' ? 1 : 0);