+ Groups lose their resize handle when they get dropped into a group (and get it back when they get pulled out)

+ Now properly handling z order for dragging and nesting groups
+ If a group is the last item inside a group, closing it now closes the outer group as well
+ Fixed bug causing the closing of unrelated tabs to destroy groups
This commit is contained in:
Ian Gilman 2010-04-02 17:33:06 -07:00
parent d75be64c1d
commit 3313e3210f

View File

@ -127,12 +127,15 @@ window.Rect.prototype = {
// ##########
// TODO generalize for any number of events
window.Subscribable = function() {
this.onCloseSubscribers = [];
this.onCloseSubscribers = null;
};
window.Subscribable.prototype = {
// ----------
addOnClose: function(referenceElement, callback) {
if(!this.onCloseSubscribers)
this.onCloseSubscribers = [];
var existing = jQuery.grep(this.onCloseSubscribers, function(element) {
return element.referenceElement == referenceElement;
});
@ -150,6 +153,9 @@ window.Subscribable.prototype = {
// ----------
removeOnClose: function(referenceElement) {
if(!this.onCloseSubscribers)
return;
this.onCloseSubscribers = jQuery.grep(this.onCloseSubscribers, function(element) {
return element.referenceElement == referenceElement;
}, true);
@ -157,6 +163,9 @@ window.Subscribable.prototype = {
// ----------
_sendOnClose: function() {
if(!this.onCloseSubscribers)
return;
jQuery.each(this.onCloseSubscribers, function(index, object) {
object.callback(this);
});