From fa06d3dad8ca39afeceef913a1886ab8f52e9e8f Mon Sep 17 00:00:00 2001 From: edward Date: Thu, 18 May 2017 13:37:56 +0800 Subject: [PATCH] Roo/LayoutRegion.js --- Roo/LayoutRegion.js | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/Roo/LayoutRegion.js b/Roo/LayoutRegion.js index 2862553e59..13b9087def 100644 --- a/Roo/LayoutRegion.js +++ b/Roo/LayoutRegion.js @@ -306,20 +306,25 @@ Roo.extend(Roo.LayoutRegion, Roo.BasicLayoutRegion, { 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(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(){ -- 2.39.2