docs/default.css
[roojs1] / docs / symbols / src / Roo_bootstrap_NavProgressItem.js.html
1 <html><head><title>../roojs1/Roo/bootstrap/NavProgressItem.js</title><link rel="stylesheet" type="text/css" href="../../../css/highlight-js.css"/></head><body class="highlightpage"><code class="jsdoc-pretty"><span class="jsdoc-comment">/*
2  * - LGPL
3  *
4  * Nav Progress Item
5  * 
6  */
7
8 /**
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
14  * @cfg {String} html
15  * 
16  * @constructor
17  * Create a new NavProgressItem
18  * @param {Object} config The config object
19  */
20 </span><span class="jsdoc-var">Roo.bootstrap.NavProgressItem </span><span class="jsdoc-syntax">= </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">config</span><span class="jsdoc-syntax">){
21     </span><span class="jsdoc-var">Roo.bootstrap.NavProgressItem.superclass.constructor.call</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">config</span><span class="jsdoc-syntax">);
22     </span><span class="jsdoc-var">this.addEvents</span><span class="jsdoc-syntax">({
23         </span><span class="jsdoc-comment">// raw events
24         /**
25          * @event click
26          * The raw click event for the entire grid.
27          * @param {Roo.bootstrap.NavProgressItem} this
28          * @param {Roo.EventObject} e
29          */
30         </span><span class="jsdoc-string">&quot;click&quot; </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">true</span><span class="jsdoc-syntax">,
31          </span><span class="jsdoc-comment">/**
32             * @event changed
33             * Fires when the active item active state changes
34             * @param {Roo.bootstrap.NavProgressItem} this
35             * @param {boolean} state the new state
36              
37          */
38         </span><span class="jsdoc-string">'changed'</span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">true
39     </span><span class="jsdoc-syntax">});
40    
41 };
42
43 </span><span class="jsdoc-var">Roo.extend</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">Roo.bootstrap.NavProgressItem</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">Roo.bootstrap.Component</span><span class="jsdoc-syntax">,  {
44     
45     </span><span class="jsdoc-var">active </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">false</span><span class="jsdoc-syntax">,
46     </span><span class="jsdoc-var">disabled </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">false</span><span class="jsdoc-syntax">,
47     </span><span class="jsdoc-var">html </span><span class="jsdoc-syntax">: </span><span class="jsdoc-string">''</span><span class="jsdoc-syntax">,
48     
49     </span><span class="jsdoc-var">getAutoCreate </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">()
50     {
51          
52         </span><span class="jsdoc-keyword">var </span><span class="jsdoc-var">cfg </span><span class="jsdoc-syntax">= {
53             </span><span class="jsdoc-var">tag</span><span class="jsdoc-syntax">: </span><span class="jsdoc-string">'li'</span><span class="jsdoc-syntax">,
54             </span><span class="jsdoc-var">cls</span><span class="jsdoc-syntax">: </span><span class="jsdoc-string">'roo-navigation-bar-item'</span><span class="jsdoc-syntax">,
55             </span><span class="jsdoc-var">cn </span><span class="jsdoc-syntax">: [
56                 {
57                     </span><span class="jsdoc-var">tag </span><span class="jsdoc-syntax">: </span><span class="jsdoc-string">'span'</span><span class="jsdoc-syntax">,
58                     </span><span class="jsdoc-var">cls </span><span class="jsdoc-syntax">: </span><span class="jsdoc-string">'roo-navigation-bar-item-text'</span><span class="jsdoc-syntax">,
59                     </span><span class="jsdoc-var">html </span><span class="jsdoc-syntax">: </span><span class="jsdoc-var">this.html
60                 </span><span class="jsdoc-syntax">}
61             ]
62         }
63         
64         </span><span class="jsdoc-keyword">if </span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this.active</span><span class="jsdoc-syntax">) {
65             </span><span class="jsdoc-var">cfg.cls </span><span class="jsdoc-syntax">+= </span><span class="jsdoc-string">' active'</span><span class="jsdoc-syntax">;
66         }
67         </span><span class="jsdoc-keyword">if </span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this.disabled</span><span class="jsdoc-syntax">) {
68             </span><span class="jsdoc-var">cfg.cls </span><span class="jsdoc-syntax">+= </span><span class="jsdoc-string">' disabled'</span><span class="jsdoc-syntax">;
69         }
70         
71         </span><span class="jsdoc-keyword">return </span><span class="jsdoc-var">cfg</span><span class="jsdoc-syntax">;
72     },
73     
74     </span><span class="jsdoc-var">initEvents</span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">() 
75     {
76         </span><span class="jsdoc-var">Roo.log</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">'bar item init???'</span><span class="jsdoc-syntax">);
77     }
78 </span><span class="jsdoc-comment">//    
79 //    onClick : function(e)
80 //    {
81 //        if(
82 //                this.preventDefault || 
83 //                this.href == '#' 
84 //        ){
85 //            
86 //            e.preventDefault();
87 //        }
88 //        
89 //        if (this.disabled) {
90 //            return;
91 //        }
92 //        
93 //        var tg = Roo.bootstrap.TabGroup.get(this.navId);
94 //        if (tg &amp;&amp; tg.transition) {
95 //            Roo.log(&quot;waiting for the transitionend&quot;);
96 //            return;
97 //        }
98 //        
99 //        
100 //        
101 //        //Roo.log(&quot;fire event clicked&quot;);
102 //        if(this.fireEvent('click', this, e) === false){
103 //            return;
104 //        };
105 //        
106 //        if(this.tagtype == 'span'){
107 //            return;
108 //        }
109 //        
110 //        //Roo.log(this.href);
111 //        var ael = this.el.select('a',true).first();
112 //        //Roo.log(ael);
113 //        
114 //        if(ael &amp;&amp; this.animateRef &amp;&amp; this.href.indexOf('#') &gt; -1){
115 //            //Roo.log([&quot;test:&quot;,ael.dom.href.split(&quot;#&quot;)[0], document.location.toString().split(&quot;#&quot;)[0]]);
116 //            if (ael.dom.href.split(&quot;#&quot;)[0] != document.location.toString().split(&quot;#&quot;)[0]) {
117 //                return; // ignore... - it's a 'hash' to another page.
118 //            }
119 //            
120 //            e.preventDefault();
121 //            this.scrollToElement(e);
122 //        }
123 //        
124 //        
125 //        var p =  this.parent();
126 //   
127 //        if (['tabs','pills'].indexOf(p.type)!==-1) {
128 //            if (typeof(p.setActiveItem) !== 'undefined') {
129 //                p.setActiveItem(this);
130 //            }
131 //        }
132 //        
133 //        // if parent is a navbarheader....- and link is probably a '#' page ref.. then remove the expanded menu.
134 //        if (p.parentType == 'NavHeaderbar' &amp;&amp; !this.menu) {
135 //            // remove the collapsed menu expand...
136 //            p.parent().el.select('.navbar-collapse',true).removeClass('in');  
137 //        }
138 //    },
139 //    
140 //    isActive: function () {
141 //        return this.active
142 //    },
143 //    setActive : function(state, fire, is_was_active)
144 //    {
145 //        if (this.active &amp;&amp; !state &amp;&amp; this.navId) {
146 //            this.was_active = true;
147 //            var nv = Roo.bootstrap.NavGroup.get(this.navId);
148 //            if (nv) {
149 //                nv.clearWasActive(this);
150 //            }
151 //            
152 //        }
153 //        this.active = state;
154 //        
155 //        if (!state ) {
156 //            this.el.removeClass('active');
157 //        } else if (!this.el.hasClass('active')) {
158 //            this.el.addClass('active');
159 //        }
160 //        if (fire) {
161 //            this.fireEvent('changed', this, state);
162 //        }
163 //        
164 //        // show a panel if it's registered and related..
165 //        
166 //        if (!this.navId || !this.tabId || !state || is_was_active) {
167 //            return;
168 //        }
169 //        
170 //        var tg = Roo.bootstrap.TabGroup.get(this.navId);
171 //        if (!tg) {
172 //            return;
173 //        }
174 //        var pan = tg.getPanelByName(this.tabId);
175 //        if (!pan) {
176 //            return;
177 //        }
178 //        // if we can not flip to new panel - go back to old nav highlight..
179 //        if (false == tg.showPanel(pan)) {
180 //            var nv = Roo.bootstrap.NavGroup.get(this.navId);
181 //            if (nv) {
182 //                var onav = nv.getWasActive();
183 //                if (onav) {
184 //                    onav.setActive(true, false, true);
185 //                }
186 //            }
187 //            
188 //        }
189 //        
190 //        
191 //      
192 //    },
193 //     // this should not be here...
194 //    setDisabled : function(state)
195 //    {
196 //        this.disabled = state;
197 //        if (!state ) {
198 //            this.el.removeClass('disabled');
199 //        } else if (!this.el.hasClass('disabled')) {
200 //            this.el.addClass('disabled');
201 //        }
202 //        
203 //    },
204 //    
205 //    /**
206 //     * Fetch the element to display the tooltip on.
207 //     * @return {Roo.Element} defaults to this.el
208 //     */
209 //    tooltipEl : function()
210 //    {
211 //        return this.el.select('' + this.tagtype + '', true).first();
212 //    },
213 //    
214 //    scrollToElement : function(e)
215 //    {
216 //        var c = document.body;
217 //        
218 //        /*
219 //         * Firefox / IE places the overflow at the html level, unless specifically styled to behave differently.
220 //         */
221 //        if(Roo.isFirefox || Roo.isIE || Roo.isIE11){
222 //            c = document.documentElement;
223 //        }
224 //        
225 //        var target = Roo.get(c).select('a[name=' + this.href.split('#')[1] +']', true).first();
226 //        
227 //        if(!target){
228 //            return;
229 //        }
230 //
231 //        var o = target.calcOffsetsTo(c);
232 //        
233 //        var options = {
234 //            target : target,
235 //            value : o[1]
236 //        }
237 //        
238 //        this.fireEvent('scrollto', this, options, e);
239 //        
240 //        Roo.get(c).scrollTo('top', options.value, true);
241 //        
242 //        return;
243 //    }
244 </span><span class="jsdoc-syntax">});
245  
246
247  </span></code></body></html>