Droppable: greedy children now consider only parents with same scope as parents. Fixed #8524 - Nested greedy droppables trigger parents events even when scopes are different

(cherry picked from commit bce0838938)
This commit is contained in:
Philipp Benjamin Köppchen 2012-08-27 20:37:04 +02:00 committed by Scott González
parent 35cf02860c
commit 1cbd513aa3

View File

@ -260,7 +260,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);