sync
[roojs1] / Roo / bootstrap / NavProgressBar.js
index 90aa446..edd8d43 100644 (file)
@@ -11,7 +11,7 @@
  * Bootstrap NavProgressBar class
  * 
  * @constructor
- * Create a new nav progress bar
+ * Create a new nav progress bar - a bar indicating step along a process
  * @param {Object} config The config object
  */
 
@@ -35,7 +35,10 @@ Roo.bootstrap.NavProgressBar = function(config){
 };
 
 Roo.extend(Roo.bootstrap.NavProgressBar, Roo.bootstrap.Component,  {
-    
+    /**
+     * @cfg {Roo.bootstrap.NavProgressItem} NavProgressBar:bullets[]
+     * Bullets for the Nav Progress bar for the toolbar
+     */
     bullets : [],
     barItems : [],
     
@@ -76,13 +79,11 @@ Roo.extend(Roo.bootstrap.NavProgressBar, Roo.bootstrap.Component,  {
     
     initEvents: function() 
     {
-        Roo.log('init?????');
-        this.format();
+        
     },
     
     onRender : function(ct, position) 
     {
-        Roo.log('render????');
         Roo.bootstrap.NavProgressBar.superclass.onRender.call(this, ct, position);
         
         if(this.bullets.length){
@@ -91,6 +92,8 @@ Roo.extend(Roo.bootstrap.NavProgressBar, Roo.bootstrap.Component,  {
             }, this);
         }
         
+        this.format();
+        
     },
     
     addItem : function(cfg)
@@ -103,27 +106,36 @@ Roo.extend(Roo.bootstrap.NavProgressBar, Roo.bootstrap.Component,  {
         if(cfg.html){
             var top = new Roo.bootstrap.Element({
                 tag : 'div',
-                cls : 'roo-navigation-bar-text',
-                html : (typeof(cfg.position) != 'undefined' && cfg.position == 'top') ? cfg.html : ''
+                cls : 'roo-navigation-bar-text'
             });
             
             var bottom = new Roo.bootstrap.Element({
                 tag : 'div',
-                cls : 'roo-navigation-bar-text',
-                html : (typeof(cfg.position) != 'undefined' && cfg.position == 'top') ? '' : cfg.html
+                cls : 'roo-navigation-bar-text'
             });
             
             top.onRender(this.el.select('.roo-navigation-top-bar', true).first(), null);
             bottom.onRender(this.el.select('.roo-navigation-bottom-bar', true).first(), null);
             
+            var topText = new Roo.bootstrap.Element({
+                tag : 'span',
+                html : (typeof(cfg.position) != 'undefined' && cfg.position == 'top') ? cfg.html : ''
+            });
+            
+            var bottomText = new Roo.bootstrap.Element({
+                tag : 'span',
+                html : (typeof(cfg.position) != 'undefined' && cfg.position == 'top') ? '' : cfg.html
+            });
+            
+            topText.onRender(top.el, null);
+            bottomText.onRender(bottom.el, null);
+            
             item.topEl = top;
             item.bottomEl = bottom;
         }
         
         this.barItems.push(item);
         
-        Roo.log(this.barItems);
-        
         return item;
     },
     
@@ -222,13 +234,10 @@ Roo.extend(Roo.bootstrap.NavProgressBar, Roo.bootstrap.Component,  {
     
     format : function()
     {
-        Roo.log(this.barItems);
-        Roo.log(this.barItems.length);
         if(!this.barItems.length){
-            Roo.log('not get here???');
             return;
         }
-        Roo.log('get here???');
+     
         var width = 100 / this.barItems.length;
         
         Roo.each(this.barItems, function(i){