diff options
author | Paul Bakaus <paul.bakaus@googlemail.com> | 2009-08-22 07:59:09 +0000 |
---|---|---|
committer | Paul Bakaus <paul.bakaus@googlemail.com> | 2009-08-22 07:59:09 +0000 |
commit | 2189deaa2c30678863d2546c9d2e30a13a5d3e1e (patch) | |
tree | 1d54a83e4aea6ed49f51ed9ca76157bf5bcf365b /ui/ui.draggable.js | |
parent | 374f2cbb55a026630bbb355d7e4cc1976908bf72 (diff) | |
download | jquery-ui-2189deaa2c30678863d2546c9d2e30a13a5d3e1e.tar.gz jquery-ui-2189deaa2c30678863d2546c9d2e30a13a5d3e1e.zip |
draggable: made stack accept a selector instead of a complex hash, min value is autodetermined now, implements #4365
Diffstat (limited to 'ui/ui.draggable.js')
-rw-r--r-- | ui/ui.draggable.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ui/ui.draggable.js b/ui/ui.draggable.js index 322592f1e..e0b587691 100644 --- a/ui/ui.draggable.js +++ b/ui/ui.draggable.js @@ -754,15 +754,16 @@ $.ui.plugin.add("draggable", "stack", { 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; } }); |