Upgrade to ExtJS 3.3.0 - Released 10/06/2010
[extjs.git] / examples / ux / ProgressBarPager.js
index 6b8ad38..2b4fd30 100644 (file)
@@ -1,6 +1,6 @@
 /*!
 /*!
- * Ext JS Library 3.0.3
- * Copyright(c) 2006-2009 Ext JS, LLC
+ * Ext JS Library 3.3.0
+ * Copyright(c) 2006-2010 Ext JS, Inc.
  * licensing@extjs.com
  * http://www.extjs.com/license
  */
  * licensing@extjs.com
  * http://www.extjs.com/license
  */
@@ -41,42 +41,41 @@ Ext.ux.ProgressBarPager  = Ext.extend(Object, {
        },
        //public
        init : function (parent) {
        },
        //public
        init : function (parent) {
-        
-        if(parent.displayInfo){
-            this.parent = parent;
-            var ind  = parent.items.indexOf(parent.displayItem);
-            parent.remove(parent.displayItem, true);
-            this.progressBar = new Ext.ProgressBar({
-                text    : this.defaultText,
-                width   : this.progBarWidth,
-                animate :  this.defaultAnimCfg
-            });                 
-           
-            parent.displayItem = this.progressBar;
-            
-            parent.add(parent.displayItem); 
-            parent.doLayout();
-            Ext.apply(parent, this.parentOverrides);        
-            
-            this.progressBar.on('render', function(pb) {
+               
+               if(parent.displayInfo){
+                       this.parent = parent;
+                       var ind  = parent.items.indexOf(parent.displayItem);
+                       parent.remove(parent.displayItem, true);
+                       this.progressBar = new Ext.ProgressBar({
+                               text    : this.defaultText,
+                               width   : this.progBarWidth,
+                               animate :  this.defaultAnimCfg
+                       });                                     
+                  
+                       parent.displayItem = this.progressBar;
+                       
+                       parent.add(parent.displayItem); 
+                       parent.doLayout();
+                       Ext.apply(parent, this.parentOverrides);                
+                       
+                       this.progressBar.on('render', function(pb) {
                 pb.mon(pb.getEl().applyStyles('cursor:pointer'), 'click', this.handleProgressBarClick, this);
             }, this, {single: true});
                 pb.mon(pb.getEl().applyStyles('cursor:pointer'), 'click', this.handleProgressBarClick, this);
             }, this, {single: true});
-                        
-        }
-          
-    },
+                                               
+               }
+                 
+       },
        // private
        // This method handles the click for the progress bar
        handleProgressBarClick : function(e){
        // private
        // This method handles the click for the progress bar
        handleProgressBarClick : function(e){
-               var parent = this.parent;
-               var displayItem = parent.displayItem;
-               
-               var box = this.progressBar.getBox();
-               var xy = e.getXY();
-               var position = xy[0]-box.x;
-               var pages = Math.ceil(parent.store.getTotalCount()/parent.pageSize);
-               
-               var newpage = Math.ceil(position/(displayItem.width/pages));
+               var parent = this.parent,
+                   displayItem = parent.displayItem,
+                   box = this.progressBar.getBox(),
+                   xy = e.getXY(),
+                   position = xy[0]-box.x,
+                   pages = Math.ceil(parent.store.getTotalCount()/parent.pageSize),
+                   newpage = Math.ceil(position/(displayItem.width/pages));
+            
                parent.changePage(newpage);
        },
        
                parent.changePage(newpage);
        },
        
@@ -86,11 +85,10 @@ Ext.ux.ProgressBarPager  = Ext.extend(Object, {
                // This method updates the information via the progress bar.
                updateInfo : function(){
                        if(this.displayItem){
                // This method updates the information via the progress bar.
                updateInfo : function(){
                        if(this.displayItem){
-                               var count   = this.store.getCount();
-                               var pgData  = this.getPageData();
-                               var pageNum = this.readPage(pgData);
-                               
-                               var msg    = count == 0 ?
+                               var count = this.store.getCount(),
+                                   pgData = this.getPageData(),
+                                   pageNum = this.readPage(pgData),
+                                   msg = count == 0 ?
                                        this.emptyMsg :
                                        String.format(
                                                this.displayMsg,
                                        this.emptyMsg :
                                        String.format(
                                                this.displayMsg,