From 74120e0df18669c0e00393ace867a6ef0c468d8f Mon Sep 17 00:00:00 2001 From: Scott González Date: Thu, 18 Feb 2010 04:46:59 +0000 Subject: Draggable: Don't try to stack if there are no elements in the stacking group. Fixes #5191 - Draggable: stack option can throw error. --- ui/jquery.ui.draggable.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index f60c54c26..9496ce3f5 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -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) { -- cgit v1.2.3