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',
65 cfg.cls += ' disabled';
71 initEvents: function()
76 // onClick : function(e)
79 // this.preventDefault ||
83 // e.preventDefault();
86 // if (this.disabled) {
90 // var tg = Roo.bootstrap.TabGroup.get(this.navId);
91 // if (tg && tg.transition) {
92 // Roo.log("waiting for the transitionend");
98 // //Roo.log("fire event clicked");
99 // if(this.fireEvent('click', this, e) === false){
103 // if(this.tagtype == 'span'){
107 // //Roo.log(this.href);
108 // var ael = this.el.select('a',true).first();
111 // if(ael && this.animateRef && this.href.indexOf('#') > -1){
112 // //Roo.log(["test:",ael.dom.href.split("#")[0], document.location.toString().split("#")[0]]);
113 // if (ael.dom.href.split("#")[0] != document.location.toString().split("#")[0]) {
114 // return; // ignore... - it's a 'hash' to another page.
117 // e.preventDefault();
118 // this.scrollToElement(e);
122 // var p = this.parent();
124 // if (['tabs','pills'].indexOf(p.type)!==-1) {
125 // if (typeof(p.setActiveItem) !== 'undefined') {
126 // p.setActiveItem(this);
130 // // if parent is a navbarheader....- and link is probably a '#' page ref.. then remove the expanded menu.
131 // if (p.parentType == 'NavHeaderbar' && !this.menu) {
132 // // remove the collapsed menu expand...
133 // p.parent().el.select('.navbar-collapse',true).removeClass('in');
137 // isActive: function () {
138 // return this.active
140 // setActive : function(state, fire, is_was_active)
142 // if (this.active && !state && this.navId) {
143 // this.was_active = true;
144 // var nv = Roo.bootstrap.NavGroup.get(this.navId);
146 // nv.clearWasActive(this);
150 // this.active = state;
153 // this.el.removeClass('active');
154 // } else if (!this.el.hasClass('active')) {
155 // this.el.addClass('active');
158 // this.fireEvent('changed', this, state);
161 // // show a panel if it's registered and related..
163 // if (!this.navId || !this.tabId || !state || is_was_active) {
167 // var tg = Roo.bootstrap.TabGroup.get(this.navId);
171 // var pan = tg.getPanelByName(this.tabId);
175 // // if we can not flip to new panel - go back to old nav highlight..
176 // if (false == tg.showPanel(pan)) {
177 // var nv = Roo.bootstrap.NavGroup.get(this.navId);
179 // var onav = nv.getWasActive();
181 // onav.setActive(true, false, true);
190 // // this should not be here...
191 // setDisabled : function(state)
193 // this.disabled = state;
195 // this.el.removeClass('disabled');
196 // } else if (!this.el.hasClass('disabled')) {
197 // this.el.addClass('disabled');
203 // * Fetch the element to display the tooltip on.
204 // * @return {Roo.Element} defaults to this.el
206 // tooltipEl : function()
208 // return this.el.select('' + this.tagtype + '', true).first();
211 // scrollToElement : function(e)
213 // var c = document.body;
216 // * Firefox / IE places the overflow at the html level, unless specifically styled to behave differently.
218 // if(Roo.isFirefox || Roo.isIE || Roo.isIE11){
219 // c = document.documentElement;
222 // var target = Roo.get(c).select('a[name=' + this.href.split('#')[1] +']', true).first();
228 // var o = target.calcOffsetsTo(c);
235 // this.fireEvent('scrollto', this, options, e);
237 // Roo.get(c).scrollTo('top', options.value, true);