X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..2e847cf21b8ab9d15fa167b315ca5b2fa92638fc:/src/widgets/ProgressBar.js diff --git a/src/widgets/ProgressBar.js b/src/widgets/ProgressBar.js index dc2a9dd6..4e71e695 100644 --- a/src/widgets/ProgressBar.js +++ b/src/widgets/ProgressBar.js @@ -1,6 +1,6 @@ /*! - * Ext JS Library 3.0.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 */ @@ -120,7 +120,7 @@ Ext.ProgressBar = Ext.extend(Ext.BoxComponent, { if(text){ this.updateText(text); } - if(this.rendered){ + if(this.rendered && !this.isDestroyed){ var w = Math.floor(value*this.el.dom.firstChild.offsetWidth); this.progressBar.setWidth(w, animate === true || (animate !== false && this.animate)); if(this.textTopEl){ @@ -197,6 +197,7 @@ myAction.on('complete', function(){ this.waitTimer = Ext.TaskMgr.start({ run: function(i){ var inc = o.increment || 10; + i -= 1; this.updateProgress(((((i+inc)%inc)+1)*(100/inc))*0.01, null, o.animate); }, interval: o.interval || 1000, @@ -275,15 +276,31 @@ myAction.on('complete', function(){ if(this.textTopEl){ this.textTopEl.addClass('x-hidden'); } + this.clearTimer(); + if(hide === true){ + this.hide(); + } + return this; + }, + + // private + clearTimer : function(){ if(this.waitTimer){ this.waitTimer.onStop = null; //prevent recursion Ext.TaskMgr.stop(this.waitTimer); this.waitTimer = null; } - if(hide === true){ - this.hide(); + }, + + onDestroy: function(){ + this.clearTimer(); + if(this.rendered){ + if(this.textEl.isComposite){ + this.textEl.clear(); + } + Ext.destroyMembers(this, 'textEl', 'progressBar', 'textTopEl'); } - return this; + Ext.ProgressBar.superclass.onDestroy.call(this); } }); Ext.reg('progress', Ext.ProgressBar); \ No newline at end of file