+ Fixed the following bug: If there's one tab in a group and you drag it out, the group will go away right away. If you drag back over it while it's fading out, you can get the red glow stuck on. At any rate, probably shouldn't delete the group until you've dropped the tab.

This commit is contained in:
Aza Raskin 2010-05-15 16:53:55 -07:00
parent f438872e3c
commit 96ad0aa070

View File

@ -563,8 +563,17 @@ window.Group.prototype = $.extend(new Item(), new Subscribable(), {
if(typeof(item.setResizable) == 'function')
item.setResizable(true);
if(this._children.length == 0 && !this.locked.close && !this.getTitle()){
this.close();
if(this._children.length == 0 && !this.locked.close && !this.getTitle()){
// Only remove the group if, after the last child is dropped, it wasn't
// dropped back into the group. We need the setTimeout because otherwise
// at the time of the mouseup the child isn't yet a child of the group.
var self = this;
a.one('mouseup', function(){
setTimeout(function(){
if( self._children.length == 0 ) self.close();
}, 50);
});
} else if(!options.dontArrange) {
this.arrange();
}