remove debugging code
[roojs1] / Roo / bootstrap / NavProgressBar.js
index dce386b..7afa07c 100644 (file)
@@ -49,22 +49,22 @@ Roo.extend(Roo.bootstrap.NavProgressBar, Roo.bootstrap.Component,  {
             cn : [
                 {
                     tag : 'div',
-                    cls : 'roo-navigation-bar-top'
+                    cls : 'roo-navigation-top-bar'
                 },
                 {
                     tag : 'div',
-                    cls : 'roo-navigation-bar',
+                    cls : 'roo-navigation-bullets-bar',
                     cn : [
                         {
                             tag : 'ul',
-                            cls : 'roo-navigation-bar-list'
+                            cls : 'roo-navigation-bar'
                         }
                     ]
                 },
                 
                 {
                     tag : 'div',
-                    cls : 'roo-navigation-bar-bottom'
+                    cls : 'roo-navigation-bottom-bar'
                 }
             ]
             
@@ -76,9 +76,6 @@ Roo.extend(Roo.bootstrap.NavProgressBar, Roo.bootstrap.Component,  {
     
     initEvents: function() 
     {
-//        this.topEl = this.el.select('.roo-navigation-bar-top', true).first();
-//        this.iconEl = this.el.select('.roo-navigation-bar-list', true).first();
-//        this.bottomEl = this.el.select('.roo-navigation-bar-bottom', true).first();
         
     },
     
@@ -92,6 +89,8 @@ Roo.extend(Roo.bootstrap.NavProgressBar, Roo.bootstrap.Component,  {
             }, this);
         }
         
+        this.format();
+        
     },
     
     addItem : function(cfg)
@@ -99,31 +98,34 @@ Roo.extend(Roo.bootstrap.NavProgressBar, Roo.bootstrap.Component,  {
         var item = new Roo.bootstrap.NavProgressItem(cfg);
         
         item.parentId = this.id;
-        item.render(this.el.select('.roo-navigation-bar-list', true).first(), null);
+        item.render(this.el.select('.roo-navigation-bar', true).first(), null);
         
         if(cfg.html){
             var top = new Roo.bootstrap.Element({
                 tag : 'div',
-                cls : 'roo-navigation-bar-text',
-                html : cfg.html
+                cls : 'roo-navigation-bar-text'
             });
             
             var bottom = new Roo.bootstrap.Element({
                 tag : 'div',
-                cls : 'roo-navigation-bar-text',
-                html : cfg.html
+                cls : 'roo-navigation-bar-text'
             });
             
-            top.onRender(this.el.select('.roo-navigation-bar-top', true).first(), null);
-            bottom.onRender(this.el.select('.roo-navigation-bar-bottom', true).first(), null);
+            top.onRender(this.el.select('.roo-navigation-top-bar', true).first(), null);
+            bottom.onRender(this.el.select('.roo-navigation-bottom-bar', true).first(), null);
             
-            top.el.setVisibilityMode(Roo.Element.DISPLAY).hide();
-            bottom.el.setVisibilityMode(Roo.Element.DISPLAY).show();
+            var topText = new Roo.bootstrap.Element({
+                tag : 'span',
+                html : (typeof(cfg.position) != 'undefined' && cfg.position == 'top') ? cfg.html : ''
+            });
             
-            if(typeof(cfg.position) != 'undefined' && cfg.position == 'top'){
-                top.el.show();
-                bottom.el.hide();
-            }
+            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;
@@ -131,8 +133,6 @@ Roo.extend(Roo.bootstrap.NavProgressBar, Roo.bootstrap.Component,  {
         
         this.barItems.push(item);
         
-        this.formatBullets();
-        
         return item;
     },
     
@@ -229,18 +229,18 @@ Roo.extend(Roo.bootstrap.NavProgressBar, Roo.bootstrap.Component,  {
         this.setActiveItem(this.barItems[i-1]);
     },
     
-    formatBullets : function()
+    format : function()
     {
         if(!this.barItems.length){
             return;
         }
-        
+     
         var width = 100 / this.barItems.length;
         
         Roo.each(this.barItems, function(i){
             i.el.setStyle('width', width + '%');
-            i.topEl.setStyle('width', width + '%');
-            i.bottomEl.setStyle('width', width + '%');
+            i.topEl.el.setStyle('width', width + '%');
+            i.bottomEl.el.setStyle('width', width + '%');
         }, this);
         
     }