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
18 * Create a new NavProgressItem
19 * @param {Object} config The config object
21 Roo.bootstrap.NavProgressItem = function(config){
22 Roo.bootstrap.NavProgressItem.superclass.constructor.call(this, config);
27 * The raw click event for the entire grid.
28 * @param {Roo.bootstrap.NavProgressItem} this
29 * @param {Roo.EventObject} e
34 * Fires when the active item active state changes
35 * @param {Roo.bootstrap.NavProgressItem} this
36 * @param {boolean} state the new state
44 Roo.extend(Roo.bootstrap.NavProgressItem, Roo.bootstrap.Component, {
51 getAutoCreate : function()
56 cls: 'roo-navigation-bar-item ' + this.position,
60 cls : 'roo-navigation-bar-item-text',
70 cfg.cls += ' disabled';
76 initEvents: function()
81 // onClick : function(e)
84 // this.preventDefault ||
88 // e.preventDefault();
91 // if (this.disabled) {
95 // var tg = Roo.bootstrap.TabGroup.get(this.navId);
96 // if (tg && tg.transition) {
97 // Roo.log("waiting for the transitionend");
103 // //Roo.log("fire event clicked");
104 // if(this.fireEvent('click', this, e) === false){
108 // if(this.tagtype == 'span'){
112 // //Roo.log(this.href);
113 // var ael = this.el.select('a',true).first();
116 // if(ael && this.animateRef && this.href.indexOf('#') > -1){
117 // //Roo.log(["test:",ael.dom.href.split("#")[0], document.location.toString().split("#")[0]]);
118 // if (ael.dom.href.split("#")[0] != document.location.toString().split("#")[0]) {
119 // return; // ignore... - it's a 'hash' to another page.
122 // e.preventDefault();
123 // this.scrollToElement(e);
127 // var p = this.parent();
129 // if (['tabs','pills'].indexOf(p.type)!==-1) {
130 // if (typeof(p.setActiveItem) !== 'undefined') {
131 // p.setActiveItem(this);
135 // // if parent is a navbarheader....- and link is probably a '#' page ref.. then remove the expanded menu.
136 // if (p.parentType == 'NavHeaderbar' && !this.menu) {
137 // // remove the collapsed menu expand...
138 // p.parent().el.select('.navbar-collapse',true).removeClass('in');
142 // isActive: function () {
143 // return this.active
145 // setActive : function(state, fire, is_was_active)
147 // if (this.active && !state && this.navId) {
148 // this.was_active = true;
149 // var nv = Roo.bootstrap.NavGroup.get(this.navId);
151 // nv.clearWasActive(this);
155 // this.active = state;
158 // this.el.removeClass('active');
159 // } else if (!this.el.hasClass('active')) {
160 // this.el.addClass('active');
163 // this.fireEvent('changed', this, state);
166 // // show a panel if it's registered and related..
168 // if (!this.navId || !this.tabId || !state || is_was_active) {
172 // var tg = Roo.bootstrap.TabGroup.get(this.navId);
176 // var pan = tg.getPanelByName(this.tabId);
180 // // if we can not flip to new panel - go back to old nav highlight..
181 // if (false == tg.showPanel(pan)) {
182 // var nv = Roo.bootstrap.NavGroup.get(this.navId);
184 // var onav = nv.getWasActive();
186 // onav.setActive(true, false, true);
195 // // this should not be here...
196 // setDisabled : function(state)
198 // this.disabled = state;
200 // this.el.removeClass('disabled');
201 // } else if (!this.el.hasClass('disabled')) {
202 // this.el.addClass('disabled');
208 // * Fetch the element to display the tooltip on.
209 // * @return {Roo.Element} defaults to this.el
211 // tooltipEl : function()
213 // return this.el.select('' + this.tagtype + '', true).first();
216 // scrollToElement : function(e)
218 // var c = document.body;
221 // * Firefox / IE places the overflow at the html level, unless specifically styled to behave differently.
223 // if(Roo.isFirefox || Roo.isIE || Roo.isIE11){
224 // c = document.documentElement;
227 // var target = Roo.get(c).select('a[name=' + this.href.split('#')[1] +']', true).first();
233 // var o = target.calcOffsetsTo(c);
240 // this.fireEvent('scrollto', this, options, e);
242 // Roo.get(c).scrollTo('top', options.value, true);