9 * @class Roo.bootstrap.NavProgressBar
10 * @extends Roo.bootstrap.Component
11 * Bootstrap NavProgressBar class
14 * Create a new nav progress bar
15 * @param {Object} config The config object
18 Roo.bootstrap.NavProgressBar = function(config){
19 Roo.bootstrap.NavProgressBar.superclass.constructor.call(this, config);
21 this.bullets = this.bullets || [];
23 // Roo.bootstrap.NavProgressBar.register(this);
27 * Fires when the active item changes
28 * @param {Roo.bootstrap.NavProgressBar} this
29 * @param {Roo.bootstrap.NavProgressItem} selected The item selected
30 * @param {Roo.bootstrap.NavProgressItem} prev The previously selected item
37 Roo.extend(Roo.bootstrap.NavProgressBar, Roo.bootstrap.Component, {
43 getAutoCreate : function()
45 var cfg = Roo.apply({}, Roo.bootstrap.NavProgressBar.superclass.getAutoCreate.call(this));
49 cls: 'roo-navigation-bar'
56 onRender : function(ct, position)
58 Roo.bootstrap.NavProgressBar.superclass.onRender.call(this, ct, position);
60 if(this.bullets.length){
61 Roo.each(this.bullets, function(b){
68 initEvents: function()
73 addItem : function(cfg)
75 var item = new Roo.bootstrap.NavProgressItem(cfg);
77 item.parentId = this.id;
78 item.onRender(this.el, null);
80 this.barItems.push(item);
87 formatBullets : function()
89 Roo.log(this.barItems);
94 // * sets the active Navigation item
95 // * @param {Roo.bootstrap.NavProgressItem} the new current navitem
97 // setActiveItem : function(item)
100 // Roo.each(this.items, function(v){
104 // if (v.isActive()) {
105 // v.setActive(false, true);
112 // item.setActive(true, true);
113 // this.fireEvent('changed', this, item, prev);
117 // * gets the active Navigation item
118 // * @return {Roo.bootstrap.NavProgressItem} the current navitem
120 // getActive : function()
122 // var active = false;
124 // Roo.each(this.items, function(v){
126 // if (!v.isActive()) {
138 // indexOfNav : function(item)
140 // var index = false;
142 // Roo.each(this.items, function(v,i){
156 * adds a Navigation item
157 * @param {Roo.bootstrap.NavProgressItem} the NavProgressItem to add
162 // * register a Navigation item
163 // * @param {Roo.bootstrap.NavItem} the navitem to add
165 // register : function(item)
167 // this.items.push(item);
168 // item.navId = this.navId;
173 // * clear all the Navigation item
176 // clearAll : function()
179 // this.el.dom.innerHTML = '';
182 // getNavItem: function(tabId)
185 // Roo.each(this.items, function(e) {
186 // if (e.tabId == tabId) {
196 // setActiveNext : function()
198 // var i = this.indexOfNav(this.getActive());
200 // if (i > this.items.length) {
204 // this.setActiveItem(this.items[i+1]);
207 // setActivePrev : function()
209 // var i = this.indexOfNav(this.getActive());
215 // this.setActiveItem(this.items[i-1]);
218 // clearWasActive : function(except) {
219 // Roo.each(this.items, function(e) {
220 // if (e.tabId != except.tabId && e.was_active) {
221 // e.was_active = false;
229 // getWasActive : function ()
232 // Roo.each(this.items, function(e) {
233 // if (e.was_active) {
247 //Roo.apply(Roo.bootstrap.NavProgressBar, {
251 // * register a Navigation Group
252 // * @param {Roo.bootstrap.NavGroup} the navgroup to add
254 // register : function(bar)
256 // this.groups[bar.navId] = bar;
260 // * fetch a Navigation Bar based on the navigation ID
261 // * @param {string} the nav bar to add
262 // * @returns {Roo.bootstrap.NavProgressBar} the nav bar
264 // get: function(navId)
266 // if (typeof(this.groups[navId]) == 'undefined') {
270 // return this.groups[navId] ;