Skip to content
Permalink
Browse files

draggable: made stack accept a selector instead of a complex hash, mi…

…n value is autodetermined now, implements #4365
  • Loading branch information...
Paul Bakaus
Paul Bakaus committed Aug 22, 2009
1 parent 374f2cb commit 2189deaa2c30678863d2546c9d2e30a13a5d3e1e
Showing with 6 additions and 5 deletions.
  1. +6 −5 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;

}
});

0 comments on commit 2189dea

Please sign in to comment.
You can’t perform that action at this time.