Draggable: Don't try to stack if there are no elements in the stacking group.

Fixes #5191 - Draggable: stack option can throw error.
This commit is contained in:
Scott González 2010-02-18 04:46:59 +00:00
parent 6d7196f803
commit 74120e0df1

View File

@ -770,6 +770,7 @@ $.ui.plugin.add("draggable", "stack", {
var group = $.makeArray($(o.stack)).sort(function(a,b) {
return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0);
});
if (!group.length) { return; }
var min = parseInt(group[0].style.zIndex) || 0;
$(group).each(function(i) {