X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2FLayoutRegion.js;h=55a88b2aa9146c426a8dc7f253419312b31e859a;hb=75cbc4ce04c9c01ac47671cb01320ce699128d00;hp=2862553e59bee0092b11c110c59e10ec91869911;hpb=a889b107e7c5db089e8213ea9d60067ea1843612;p=roojs1 diff --git a/Roo/LayoutRegion.js b/Roo/LayoutRegion.js index 2862553e59..55a88b2aa9 100644 --- a/Roo/LayoutRegion.js +++ b/Roo/LayoutRegion.js @@ -302,24 +302,29 @@ Roo.extend(Roo.LayoutRegion, Roo.BasicLayoutRegion, { * Collapses this region. * @param {Boolean} skipAnim (optional) true to collapse the element without animation (if animate is true) */ - collapse : function(skipAnim){ + collapse : function(skipAnim, skipCheck){ if(this.collapsed) { return; } - this.collapsed = true; - if(this.split){ - this.split.el.hide(); - } - if(this.config.animate && skipAnim !== true){ - this.fireEvent("invalidated", this); - this.animateCollapse(); - }else{ - this.el.setLocation(-20000,-20000); - this.el.hide(); - this.collapsedEl.show(); - this.fireEvent("collapsed", this); - this.fireEvent("invalidated", this); + + if(skipCheck || this.fireEvent("beforecollapse", this) != false){ + + this.collapsed = true; + if(this.split){ + this.split.el.hide(); + } + if(this.config.animate && skipAnim !== true){ + this.fireEvent("invalidated", this); + this.animateCollapse(); + }else{ + this.el.setLocation(-20000,-20000); + this.el.hide(); + this.collapsedEl.show(); + this.fireEvent("collapsed", this); + this.fireEvent("invalidated", this); + } } + }, animateCollapse : function(){