9 * @class Roo.bootstrap.NavProgressItem
10 * @extends Roo.bootstrap.Component
11 * Bootstrap NavProgressItem class
12 * @cfg {Boolean} active (true|false) Is item active default false
13 * @cfg {Boolean} disabled (true|false) Is item active default false
15 * @cfg {String} position (top|bottom) text position default bottom
16 * @cfg {String} icon show icon instead of number
19 * Create a new NavProgressItem
20 * @param {Object} config The config object
22 Roo.bootstrap.NavProgressItem = function(config){
23 Roo.bootstrap.NavProgressItem.superclass.constructor.call(this, config);
28 * The raw click event for the entire grid.
29 * @param {Roo.bootstrap.NavProgressItem} this
30 * @param {Roo.EventObject} e
35 * Fires when the active item active state changes
36 * @param {Roo.bootstrap.NavProgressItem} this
37 * @param {boolean} state the new state
45 Roo.extend(Roo.bootstrap.NavProgressItem, Roo.bootstrap.Component, {
53 getAutoCreate : function()
58 cls: 'roo-navigation-bar-item',
62 cls : 'roo-navigation-bar-item-icon ' + this.icon ? this.icon : ''
66 cls : 'roo-navigation-bar-item-text ' + this.position,
76 cfg.cls += ' disabled';
82 initEvents: function()
87 // onClick : function(e)
90 // this.preventDefault ||
94 // e.preventDefault();
97 // if (this.disabled) {
101 // var tg = Roo.bootstrap.TabGroup.get(this.navId);
102 // if (tg && tg.transition) {
103 // Roo.log("waiting for the transitionend");
109 // //Roo.log("fire event clicked");
110 // if(this.fireEvent('click', this, e) === false){
114 // if(this.tagtype == 'span'){
118 // //Roo.log(this.href);
119 // var ael = this.el.select('a',true).first();
122 // if(ael && this.animateRef && this.href.indexOf('#') > -1){
123 // //Roo.log(["test:",ael.dom.href.split("#")[0], document.location.toString().split("#")[0]]);
124 // if (ael.dom.href.split("#")[0] != document.location.toString().split("#")[0]) {
125 // return; // ignore... - it's a 'hash' to another page.
128 // e.preventDefault();
129 // this.scrollToElement(e);
133 // var p = this.parent();
135 // if (['tabs','pills'].indexOf(p.type)!==-1) {
136 // if (typeof(p.setActiveItem) !== 'undefined') {
137 // p.setActiveItem(this);
141 // // if parent is a navbarheader....- and link is probably a '#' page ref.. then remove the expanded menu.
142 // if (p.parentType == 'NavHeaderbar' && !this.menu) {
143 // // remove the collapsed menu expand...
144 // p.parent().el.select('.navbar-collapse',true).removeClass('in');
148 // isActive: function () {
149 // return this.active
151 // setActive : function(state, fire, is_was_active)
153 // if (this.active && !state && this.navId) {
154 // this.was_active = true;
155 // var nv = Roo.bootstrap.NavGroup.get(this.navId);
157 // nv.clearWasActive(this);
161 // this.active = state;
164 // this.el.removeClass('active');
165 // } else if (!this.el.hasClass('active')) {
166 // this.el.addClass('active');
169 // this.fireEvent('changed', this, state);
172 // // show a panel if it's registered and related..
174 // if (!this.navId || !this.tabId || !state || is_was_active) {
178 // var tg = Roo.bootstrap.TabGroup.get(this.navId);
182 // var pan = tg.getPanelByName(this.tabId);
186 // // if we can not flip to new panel - go back to old nav highlight..
187 // if (false == tg.showPanel(pan)) {
188 // var nv = Roo.bootstrap.NavGroup.get(this.navId);
190 // var onav = nv.getWasActive();
192 // onav.setActive(true, false, true);
201 // // this should not be here...
202 // setDisabled : function(state)
204 // this.disabled = state;
206 // this.el.removeClass('disabled');
207 // } else if (!this.el.hasClass('disabled')) {
208 // this.el.addClass('disabled');
214 // * Fetch the element to display the tooltip on.
215 // * @return {Roo.Element} defaults to this.el
217 // tooltipEl : function()
219 // return this.el.select('' + this.tagtype + '', true).first();
222 // scrollToElement : function(e)
224 // var c = document.body;
227 // * Firefox / IE places the overflow at the html level, unless specifically styled to behave differently.
229 // if(Roo.isFirefox || Roo.isIE || Roo.isIE11){
230 // c = document.documentElement;
233 // var target = Roo.get(c).select('a[name=' + this.href.split('#')[1] +']', true).first();
239 // var o = target.calcOffsetsTo(c);
246 // this.fireEvent('scrollto', this, options, e);
248 // Roo.get(c).scrollTo('top', options.value, true);