Upgrade to ExtJS 3.1.1 - Released 02/08/2010
[extjs.git] / src / widgets / ProgressBar.js
index 875211c..4e71e69 100644 (file)
@@ -1,6 +1,6 @@
 /*!
 /*!
- * Ext JS Library 3.1.0
- * Copyright(c) 2006-2009 Ext JS, LLC
+ * Ext JS Library 3.1.1
+ * Copyright(c) 2006-2010 Ext JS, LLC
  * licensing@extjs.com
  * http://www.extjs.com/license
  */
  * licensing@extjs.com
  * http://www.extjs.com/license
  */
@@ -120,7 +120,7 @@ Ext.ProgressBar = Ext.extend(Ext.BoxComponent, {
         if(text){\r
             this.updateText(text);\r
         }\r
         if(text){\r
             this.updateText(text);\r
         }\r
-        if(this.rendered){\r
+        if(this.rendered && !this.isDestroyed){\r
             var w = Math.floor(value*this.el.dom.firstChild.offsetWidth);\r
             this.progressBar.setWidth(w, animate === true || (animate !== false && this.animate));\r
             if(this.textTopEl){\r
             var w = Math.floor(value*this.el.dom.firstChild.offsetWidth);\r
             this.progressBar.setWidth(w, animate === true || (animate !== false && this.animate));\r
             if(this.textTopEl){\r
@@ -276,18 +276,24 @@ myAction.on('complete', function(){
         if(this.textTopEl){\r
             this.textTopEl.addClass('x-hidden');\r
         }\r
         if(this.textTopEl){\r
             this.textTopEl.addClass('x-hidden');\r
         }\r
+        this.clearTimer();\r
+        if(hide === true){\r
+            this.hide();\r
+        }\r
+        return this;\r
+    },\r
+    \r
+    // private\r
+    clearTimer : function(){\r
         if(this.waitTimer){\r
             this.waitTimer.onStop = null; //prevent recursion\r
             Ext.TaskMgr.stop(this.waitTimer);\r
             this.waitTimer = null;\r
         }\r
         if(this.waitTimer){\r
             this.waitTimer.onStop = null; //prevent recursion\r
             Ext.TaskMgr.stop(this.waitTimer);\r
             this.waitTimer = null;\r
         }\r
-        if(hide === true){\r
-            this.hide();\r
-        }\r
-        return this;\r
     },\r
     \r
     onDestroy: function(){\r
     },\r
     \r
     onDestroy: function(){\r
+        this.clearTimer();\r
         if(this.rendered){\r
             if(this.textEl.isComposite){\r
                 this.textEl.clear();\r
         if(this.rendered){\r
             if(this.textEl.isComposite){\r
                 this.textEl.clear();\r