r3105 committed - draggable: made stack accept a selector instead of a complex hash, min...

r3105 committed - draggable: made stack accept a selector instead of a complex hash, min...


Revision: 3105
Author: paul.bakaus
Date: Sat Aug 22 00:59:09 2009
Log: draggable: made stack accept a selector instead of a complex hash, min
value is autodetermined now, implements #4365
http://code.google.com/p/jquery-ui/source/detail?r=3105
Modified:
/trunk/ui/ui.draggable.js
=======================================
--- /trunk/ui/ui.draggable.js    Fri Aug 21 07:13:47 2009
+++ /trunk/ui/ui.draggable.js    Sat Aug 22 00:59:09 2009
@@ -754,15 +754,16 @@
        var o = $(this).data("draggable").options;
-        var group = $.makeArray($(o.stack.group)).sort(function(a,b) {
-            return (parseInt($(a).css("zIndex"),10) || o.stack.min) -
(parseInt($(b).css("zIndex"),10) || o.stack.min);
+        var group = $.makeArray($(o.stack)).sort(function(a,b) {
+            return (parseInt($(a).css("zIndex"),10) || 0) -
(parseInt($(b).css("zIndex"),10) || 0);
        });
-
+
+        var min = parseInt(group[0].style.zIndex) || 0;
        $(group).each(function(i) {
-            this.style.zIndex = o.stack.min + i;
+            this.style.zIndex = min + i;
        });
-        this[0].style.zIndex = o.stack.min + group.length;
+        this[0].style.zIndex = min + group.length;
    }
});