Simple status box for the sidebar.
[elgg_plugins.git] / yui / docs / menuitem.js.html
blob43c8de69cbe277ca150c29da045923cfe3753ef5
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <title>API: menu menuitem.js (YUI Library)</title>
5 <link rel="stylesheet" type="text/css" href="assets/api.css">
6 </head>
8 <body id="yahoo-com">
9 <div id="doc3" class="yui-t2">
11 <div id="hd">
12 <h1>Yahoo! UI Library</h1>
13 <h3>Menu&nbsp; <span class="subtitle">2.2.0</span></h3>
14 <p>
15 <a href="./index.html">Yahoo! UI Library</a>
16 &gt; <a href="./module_menu.html">menu</a>
18 &gt; menuitem.js (source view)
19 </p>
20 </div>
22 <div id="bd">
23 <div id="yui-main">
24 <div class="yui-b">
26 <div id="srcout">
27 <div class="highlight" ><pre><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
29 <span class="k">var</span> <span class="nx">Dom</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">,</span>
30 <span class="nx">Module</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Module</span><span class="o">,</span>
31 <span class="nx">Menu</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Menu</span><span class="o">,</span>
33 <span class="nx">m_oMenuItemElement</span> <span class="o">=</span> <span class="kc">null</span><span class="o">,</span>
34 <span class="nx">m_oSubmenuIndicator</span> <span class="o">=</span> <span class="kc">null</span><span class="o">,</span>
35 <span class="nx">m_oCheckedIndicator</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
38 <span class="c">/**</span>
39 <span class="c">* Creates an item for a menu.</span>
40 <span class="c">* </span>
41 <span class="c">* @param {String} p_oObject String specifying the text of the menu item.</span>
42 <span class="c">* @param {&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-</span>
43 <span class="c">* one-html.html#ID-74680021&quot;&gt;HTMLLIElement&lt;/a&gt;} p_oObject Object specifying </span>
44 <span class="c">* the &lt;code&gt;&amp;#60;li&amp;#62;&lt;/code&gt; element of the menu item.</span>
45 <span class="c">* @param {&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-</span>
46 <span class="c">* one-html.html#ID-38450247&quot;&gt;HTMLOptGroupElement&lt;/a&gt;} p_oObject Object </span>
47 <span class="c">* specifying the &lt;code&gt;&amp;#60;optgroup&amp;#62;&lt;/code&gt; element of the menu item.</span>
48 <span class="c">* @param {&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-</span>
49 <span class="c">* one-html.html#ID-70901257&quot;&gt;HTMLOptionElement&lt;/a&gt;} p_oObject Object </span>
50 <span class="c">* specifying the &lt;code&gt;&amp;#60;option&amp;#62;&lt;/code&gt; element of the menu item.</span>
51 <span class="c">* @param {Object} p_oConfig Optional. Object literal specifying the </span>
52 <span class="c">* configuration for the menu item. See configuration class documentation </span>
53 <span class="c">* for more details.</span>
54 <span class="c">* @class MenuItem</span>
55 <span class="c">* @constructor</span>
56 <span class="c">*/</span>
57 <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">MenuItem</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">p_oObject</span><span class="o">,</span> <span class="nx">p_oConfig</span><span class="o">)</span> <span class="o">{</span>
59 <span class="k">if</span><span class="o">(</span><span class="nx">p_oObject</span><span class="o">)</span> <span class="o">{</span>
61 <span class="k">if</span><span class="o">(</span><span class="nx">p_oConfig</span><span class="o">)</span> <span class="o">{</span>
63 <span class="k">this</span><span class="o">.</span><span class="nx">parent</span> <span class="o">=</span> <span class="nx">p_oConfig</span><span class="o">.</span><span class="nx">parent</span><span class="o">;</span>
64 <span class="k">this</span><span class="o">.</span><span class="nx">value</span> <span class="o">=</span> <span class="nx">p_oConfig</span><span class="o">.</span><span class="nx">value</span><span class="o">;</span>
65 <span class="k">this</span><span class="o">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">p_oConfig</span><span class="o">.</span><span class="nx">id</span><span class="o">;</span>
67 <span class="o">}</span>
69 <span class="k">this</span><span class="o">.</span><span class="nx">init</span><span class="o">(</span><span class="nx">p_oObject</span><span class="o">,</span> <span class="nx">p_oConfig</span><span class="o">);</span>
71 <span class="o">}</span>
73 <span class="o">};</span>
76 <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">MenuItem</span><span class="o">.</span><span class="nx">prototype</span> <span class="o">=</span> <span class="o">{</span>
78 <span class="c">// Constants</span>
79 <span class="c"></span>
81 <span class="c">/**</span>
82 <span class="c"> * @property SUBMENU_INDICATOR_IMAGE_PATH</span>
83 <span class="c"> * @description String representing the path to the image to be used for the </span>
84 <span class="c"> * menu item&#39;s submenu arrow indicator.</span>
85 <span class="c"> * @default &quot;nt/ic/ut/alt1/menuarorght8_nrm_1.gif&quot;</span>
86 <span class="c"> * @final</span>
87 <span class="c"> * @type String</span>
88 <span class="c"> * @deprecated All submenu indicator images are applied via a CSS </span>
89 <span class="c"> * background image. See &quot;submenuindicator&quot; class name in menu.css.</span>
90 <span class="c"> */</span>
91 <span class="nx">SUBMENU_INDICATOR_IMAGE_PATH</span><span class="o">:</span> <span class="s2">&quot;nt/ic/ut/alt1/menuarorght8_nrm_1.gif&quot;</span><span class="o">,</span>
94 <span class="c">/**</span>
95 <span class="c"> * @property SELECTED_SUBMENU_INDICATOR_IMAGE_PATH</span>
96 <span class="c"> * @description String representing the path to the image to be used for the </span>
97 <span class="c"> * submenu arrow indicator when the menu item is selected.</span>
98 <span class="c"> * @default &quot;nt/ic/ut/alt1/menuarorght8_hov_1.gif&quot;</span>
99 <span class="c"> * @final</span>
100 <span class="c"> * @type String</span>
101 <span class="c"> * @deprecated All submenu indicator images are applied via a CSS </span>
102 <span class="c"> * background image. See &quot;submenuindicator&quot; class name in menu.css.</span>
103 <span class="c"> */</span>
104 <span class="nx">SELECTED_SUBMENU_INDICATOR_IMAGE_PATH</span><span class="o">:</span>
105 <span class="s2">&quot;nt/ic/ut/alt1/menuarorght8_hov_1.gif&quot;</span><span class="o">,</span>
108 <span class="c">/**</span>
109 <span class="c"> * @property DISABLED_SUBMENU_INDICATOR_IMAGE_PATH</span>
110 <span class="c"> * @description String representing the path to the image to be used for the </span>
111 <span class="c"> * submenu arrow indicator when the menu item is disabled.</span>
112 <span class="c"> * @default &quot;nt/ic/ut/alt1/menuarorght8_dim_1.gif&quot;</span>
113 <span class="c"> * @final</span>
114 <span class="c"> * @type String</span>
115 <span class="c"> * @deprecated All submenu indicator images are applied via a CSS </span>
116 <span class="c"> * background image. See &quot;submenuindicator&quot; class name in menu.css.</span>
117 <span class="c"> */</span>
118 <span class="nx">DISABLED_SUBMENU_INDICATOR_IMAGE_PATH</span><span class="o">:</span>
119 <span class="s2">&quot;nt/ic/ut/alt1/menuarorght8_dim_1.gif&quot;</span><span class="o">,</span>
122 <span class="c">/**</span>
123 <span class="c"> * @property COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT</span>
124 <span class="c"> * @description String representing the alt text for the image to be used </span>
125 <span class="c"> * for the submenu arrow indicator.</span>
126 <span class="c"> * @default &quot;Collapsed. Click to expand.&quot;</span>
127 <span class="c"> * @final</span>
128 <span class="c"> * @type String</span>
129 <span class="c"> * @deprecated Use COLLAPSED_SUBMENU_INDICATOR_TEXT.</span>
130 <span class="c"> */</span>
131 <span class="nx">COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT</span><span class="o">:</span> <span class="s2">&quot;Collapsed. Click to expand.&quot;</span><span class="o">,</span>
134 <span class="c">/**</span>
135 <span class="c"> * @property EXPANDED_SUBMENU_INDICATOR_ALT_TEXT</span>
136 <span class="c"> * @description String representing the alt text for the image to be used </span>
137 <span class="c"> * for the submenu arrow indicator when the submenu is visible.</span>
138 <span class="c"> * @default &quot;Expanded. Click to collapse.&quot;</span>
139 <span class="c"> * @final</span>
140 <span class="c"> * @type String</span>
141 <span class="c"> * @deprecated Use EXPANDED_SUBMENU_INDICATOR_TEXT.</span>
142 <span class="c"> */</span>
143 <span class="nx">EXPANDED_SUBMENU_INDICATOR_ALT_TEXT</span><span class="o">:</span> <span class="s2">&quot;Expanded. Click to collapse.&quot;</span><span class="o">,</span>
146 <span class="c">/**</span>
147 <span class="c"> * @property DISABLED_SUBMENU_INDICATOR_ALT_TEXT</span>
148 <span class="c"> * @description String representing the alt text for the image to be used </span>
149 <span class="c"> * for the submenu arrow indicator when the menu item is disabled.</span>
150 <span class="c"> * @default &quot;Disabled.&quot;</span>
151 <span class="c"> * @final</span>
152 <span class="c"> * @type String</span>
153 <span class="c"> * @deprecated Use DISABLED_SUBMENU_INDICATOR_TEXT.</span>
154 <span class="c"> */</span>
155 <span class="nx">DISABLED_SUBMENU_INDICATOR_ALT_TEXT</span><span class="o">:</span> <span class="s2">&quot;Disabled.&quot;</span><span class="o">,</span>
158 <span class="c">/**</span>
159 <span class="c"> * @property COLLAPSED_SUBMENU_INDICATOR_TEXT</span>
160 <span class="c"> * @description String representing the text for the &lt;code&gt;&amp;#60;em&amp;#62;&lt;code&gt;</span>
161 <span class="c"> * element used for the submenu arrow indicator.</span>
162 <span class="c"> * @default &quot;Submenu collapsed. Click to expand submenu.&quot;</span>
163 <span class="c"> * @final</span>
164 <span class="c"> * @type String</span>
165 <span class="c"> */</span>
166 <span class="nx">COLLAPSED_SUBMENU_INDICATOR_TEXT</span><span class="o">:</span>
167 <span class="s2">&quot;Submenu collapsed. Click to expand submenu.&quot;</span><span class="o">,</span>
170 <span class="c">/**</span>
171 <span class="c"> * @property EXPANDED_SUBMENU_INDICATOR_TEXT</span>
172 <span class="c"> * @description String representing the text for the submenu arrow indicator </span>
173 <span class="c"> * element (&lt;code&gt;&amp;#60;em&amp;#62;&lt;code&gt;) when the submenu is visible.</span>
174 <span class="c"> * @default &quot;Submenu expanded. Click to collapse submenu.&quot;</span>
175 <span class="c"> * @final</span>
176 <span class="c"> * @type String</span>
177 <span class="c"> */</span>
178 <span class="nx">EXPANDED_SUBMENU_INDICATOR_TEXT</span><span class="o">:</span>
179 <span class="s2">&quot;Submenu expanded. Click to collapse submenu.&quot;</span><span class="o">,</span>
182 <span class="c">/**</span>
183 <span class="c"> * @property DISABLED_SUBMENU_INDICATOR_TEXT</span>
184 <span class="c"> * @description String representing the text for the submenu arrow indicator </span>
185 <span class="c"> * element (&lt;code&gt;&amp;#60;em&amp;#62;&lt;code&gt;) when the menu item is disabled.</span>
186 <span class="c"> * @default &quot;Submenu collapsed. (Item disabled.).&quot;</span>
187 <span class="c"> * @final</span>
188 <span class="c"> * @type String</span>
189 <span class="c"> */</span>
190 <span class="nx">DISABLED_SUBMENU_INDICATOR_TEXT</span><span class="o">:</span> <span class="s2">&quot;Submenu collapsed. (Item disabled.)&quot;</span><span class="o">,</span>
193 <span class="c">/**</span>
194 <span class="c"> * @property CHECKED_IMAGE_PATH</span>
195 <span class="c"> * @description String representing the path to the image to be used for </span>
196 <span class="c"> * the checked state.</span>
197 <span class="c"> * @default &quot;nt/ic/ut/bsc/menuchk8_nrm_1.gif&quot;</span>
198 <span class="c"> * @final</span>
199 <span class="c"> * @type String</span>
200 <span class="c"> * @deprecated All checked indicator images are applied via a CSS </span>
201 <span class="c"> * background image. See &quot;checkedindicator&quot; class name in menu.css.</span>
202 <span class="c"> */</span>
203 <span class="nx">CHECKED_IMAGE_PATH</span><span class="o">:</span> <span class="s2">&quot;nt/ic/ut/bsc/menuchk8_nrm_1.gif&quot;</span><span class="o">,</span>
206 <span class="c">/**</span>
207 <span class="c"> * @property SELECTED_CHECKED_IMAGE_PATH</span>
208 <span class="c"> * @description String representing the path to the image to be used for </span>
209 <span class="c"> * the selected checked state.</span>
210 <span class="c"> * @default &quot;nt/ic/ut/bsc/menuchk8_hov_1.gif&quot;</span>
211 <span class="c"> * @final</span>
212 <span class="c"> * @type String</span>
213 <span class="c"> * @deprecated All checked indicator images are applied via a CSS </span>
214 <span class="c"> * background image. See &quot;checkedindicator&quot; class name in menu.css.</span>
215 <span class="c"> */</span>
216 <span class="nx">SELECTED_CHECKED_IMAGE_PATH</span><span class="o">:</span> <span class="s2">&quot;nt/ic/ut/bsc/menuchk8_hov_1.gif&quot;</span><span class="o">,</span>
219 <span class="c">/**</span>
220 <span class="c"> * @property DISABLED_CHECKED_IMAGE_PATH</span>
221 <span class="c"> * @description String representing the path to the image to be used for </span>
222 <span class="c"> * the disabled checked state.</span>
223 <span class="c"> * @default &quot;nt/ic/ut/bsc/menuchk8_dim_1.gif&quot;</span>
224 <span class="c"> * @final</span>
225 <span class="c"> * @type String</span>
226 <span class="c"> * @deprecated All checked indicator images are applied via a CSS </span>
227 <span class="c"> * background image.</span>
228 <span class="c"> */</span>
229 <span class="nx">DISABLED_CHECKED_IMAGE_PATH</span><span class="o">:</span> <span class="s2">&quot;nt/ic/ut/bsc/menuchk8_dim_1.gif&quot;</span><span class="o">,</span>
232 <span class="c">/**</span>
233 <span class="c"> * @property CHECKED_IMAGE_ALT_TEXT</span>
234 <span class="c"> * @description String representing the alt text for the image to be used </span>
235 <span class="c"> * for the checked image.</span>
236 <span class="c"> * @default &quot;Checked.&quot;</span>
237 <span class="c"> * @final</span>
238 <span class="c"> * @type String</span>
239 <span class="c"> * @deprecated Use CHECKED_TEXT.</span>
240 <span class="c"> */</span>
241 <span class="nx">CHECKED_IMAGE_ALT_TEXT</span><span class="o">:</span> <span class="s2">&quot;Checked.&quot;</span><span class="o">,</span>
244 <span class="c">/**</span>
245 <span class="c"> * @property DISABLED_CHECKED_IMAGE_ALT_TEXT</span>
246 <span class="c"> * @description String representing the alt text for the image to be used </span>
247 <span class="c"> * for the checked image when the item is disabled.</span>
248 <span class="c"> * @default &quot;Checked. (Item disabled.)&quot;</span>
249 <span class="c"> * @final</span>
250 <span class="c"> * @type String</span>
251 <span class="c"> * @deprecated Use DISABLED_CHECKED_TEXT.</span>
252 <span class="c"> */</span>
253 <span class="nx">DISABLED_CHECKED_IMAGE_ALT_TEXT</span><span class="o">:</span> <span class="s2">&quot;Checked. (Item disabled.)&quot;</span><span class="o">,</span>
256 <span class="c">/**</span>
257 <span class="c"> * @property CHECKED_TEXT</span>
258 <span class="c"> * @description String representing the text to be used for the checked </span>
259 <span class="c"> * indicator element (&lt;code&gt;&amp;#60;em&amp;#62;&lt;code&gt;).</span>
260 <span class="c"> * @default &quot;Checked.&quot;</span>
261 <span class="c"> * @final</span>
262 <span class="c"> * @type String</span>
263 <span class="c"> */</span>
264 <span class="nx">CHECKED_TEXT</span><span class="o">:</span> <span class="s2">&quot;Menu item checked.&quot;</span><span class="o">,</span>
267 <span class="c">/**</span>
268 <span class="c"> * @property DISABLED_CHECKED_TEXT</span>
269 <span class="c"> * @description String representing the text to be used for the checked </span>
270 <span class="c"> * indicator element (&lt;code&gt;&amp;#60;em&amp;#62;&lt;code&gt;) when the menu item </span>
271 <span class="c"> * is disabled.</span>
272 <span class="c"> * @default &quot;Checked. (Item disabled.)&quot;</span>
273 <span class="c"> * @final</span>
274 <span class="c"> * @type String</span>
275 <span class="c"> */</span>
276 <span class="nx">DISABLED_CHECKED_TEXT</span><span class="o">:</span> <span class="s2">&quot;Checked. (Item disabled.)&quot;</span><span class="o">,</span>
279 <span class="c">/**</span>
280 <span class="c"> * @property CSS_CLASS_NAME</span>
281 <span class="c"> * @description String representing the CSS class(es) to be applied to the </span>
282 <span class="c"> * &lt;code&gt;&amp;#60;li&amp;#62;&lt;/code&gt; element of the menu item.</span>
283 <span class="c"> * @default &quot;yuimenuitem&quot;</span>
284 <span class="c"> * @final</span>
285 <span class="c"> * @type String</span>
286 <span class="c"> */</span>
287 <span class="nx">CSS_CLASS_NAME</span><span class="o">:</span> <span class="s2">&quot;yuimenuitem&quot;</span><span class="o">,</span>
290 <span class="c">/**</span>
291 <span class="c"> * @property SUBMENU_TYPE</span>
292 <span class="c"> * @description Object representing the type of menu to instantiate and </span>
293 <span class="c"> * add when parsing the child nodes of the menu item&#39;s source HTML element.</span>
294 <span class="c"> * @final</span>
295 <span class="c"> * @type YAHOO.widget.Menu</span>
296 <span class="c"> */</span>
297 <span class="nx">SUBMENU_TYPE</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
300 <span class="c">/**</span>
301 <span class="c"> * @property IMG_ROOT</span>
302 <span class="c"> * @description String representing the prefix path to use for </span>
303 <span class="c"> * non-secure images.</span>
304 <span class="c"> * @default &quot;http://us.i1.yimg.com/us.yimg.com/i/&quot;</span>
305 <span class="c"> * @type String</span>
306 <span class="c"> * @deprecated All menu item images are now applied via CSS </span>
307 <span class="c"> * background images.</span>
308 <span class="c"> */</span>
309 <span class="nx">IMG_ROOT</span><span class="o">:</span> <span class="s2">&quot;http://us.i1.yimg.com/us.yimg.com/i/&quot;</span><span class="o">,</span>
312 <span class="c">/**</span>
313 <span class="c"> * @property IMG_ROOT_SSL</span>
314 <span class="c"> * @description String representing the prefix path to use for securely </span>
315 <span class="c"> * served images.</span>
316 <span class="c"> * @default &quot;https://a248.e.akamai.net/sec.yimg.com/i/&quot;</span>
317 <span class="c"> * @type String</span>
318 <span class="c"> * @deprecated All menu item images are now applied via CSS </span>
319 <span class="c"> * background images.</span>
320 <span class="c"> */</span>
321 <span class="nx">IMG_ROOT_SSL</span><span class="o">:</span> <span class="s2">&quot;https://a248.e.akamai.net/sec.yimg.com/i/&quot;</span><span class="o">,</span>
325 <span class="c">// Private member variables</span>
326 <span class="c"></span>
328 <span class="c">/**</span>
329 <span class="c"> * @property _oAnchor</span>
330 <span class="c"> * @description Object reference to the menu item&#39;s </span>
331 <span class="c"> * &lt;code&gt;&amp;#60;a&amp;#62;&lt;/code&gt; element.</span>
332 <span class="c"> * @default null </span>
333 <span class="c"> * @private</span>
334 <span class="c"> * @type &lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-</span>
335 <span class="c"> * one-html.html#ID-48250443&quot;&gt;HTMLAnchorElement&lt;/a&gt;</span>
336 <span class="c"> */</span>
337 <span class="nx">_oAnchor</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
340 <span class="c">/**</span>
341 <span class="c"> * @property _oText</span>
342 <span class="c"> * @description Object reference to the menu item&#39;s text node.</span>
343 <span class="c"> * @default null</span>
344 <span class="c"> * @private</span>
345 <span class="c"> * @type TextNode</span>
346 <span class="c"> */</span>
347 <span class="nx">_oText</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
350 <span class="c">/**</span>
351 <span class="c"> * @property _oHelpTextEM</span>
352 <span class="c"> * @description Object reference to the menu item&#39;s help text </span>
353 <span class="c"> * &lt;code&gt;&amp;#60;em&amp;#62;&lt;/code&gt; element.</span>
354 <span class="c"> * @default null</span>
355 <span class="c"> * @private</span>
356 <span class="c"> * @type &lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-</span>
357 <span class="c"> * one-html.html#ID-58190037&quot;&gt;HTMLElement&lt;/a&gt;</span>
358 <span class="c"> */</span>
359 <span class="nx">_oHelpTextEM</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
362 <span class="c">/**</span>
363 <span class="c"> * @property _oSubmenu</span>
364 <span class="c"> * @description Object reference to the menu item&#39;s submenu.</span>
365 <span class="c"> * @default null</span>
366 <span class="c"> * @private</span>
367 <span class="c"> * @type YAHOO.widget.Menu</span>
368 <span class="c"> */</span>
369 <span class="nx">_oSubmenu</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
372 <span class="c">/**</span>
373 <span class="c"> * @property _checkImage</span>
374 <span class="c"> * @description Object reference to the menu item&#39;s checkmark image.</span>
375 <span class="c"> * @default null</span>
376 <span class="c"> * @private</span>
377 <span class="c"> * @type &lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-</span>
378 <span class="c"> * one-html.html#ID-17701901&quot;&gt;HTMLImageElement&lt;/a&gt;</span>
379 <span class="c"> * @deprecated Use _oCheckedIndicator.</span>
380 <span class="c"> */</span>
381 <span class="nx">_checkImage</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
384 <span class="c">/**</span>
385 <span class="c"> * @property _oCheckedIndicator</span>
386 <span class="c"> * @description Object reference to the menu item&#39;s checkmark image.</span>
387 <span class="c"> * @default &lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/</span>
388 <span class="c"> * level-one-html.html#ID-58190037&quot;&gt;HTMLElement&lt;/a&gt;</span>
389 <span class="c"> * @private</span>
390 <span class="c"> * @type &lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/</span>
391 <span class="c"> * level-one-html.html#ID-58190037&quot;&gt;HTMLElement&lt;/a&gt;</span>
392 <span class="c"> */</span>
393 <span class="nx">_oCheckedIndicator</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
396 <span class="c">/** </span>
397 <span class="c"> * @property _oOnclickAttributeValue</span>
398 <span class="c"> * @description Object reference to the menu item&#39;s current value for the </span>
399 <span class="c"> * &quot;onclick&quot; configuration attribute.</span>
400 <span class="c"> * @default null</span>
401 <span class="c"> * @private</span>
402 <span class="c"> * @type Object</span>
403 <span class="c"> */</span>
404 <span class="nx">_oOnclickAttributeValue</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
407 <span class="c">/**</span>
408 <span class="c"> * @property _sClassName</span>
409 <span class="c"> * @description The current value of the &quot;classname&quot; configuration attribute.</span>
410 <span class="c"> * @default null</span>
411 <span class="c"> * @private</span>
412 <span class="c"> * @type String</span>
413 <span class="c"> */</span>
414 <span class="nx">_sClassName</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
418 <span class="c">// Public properties</span>
419 <span class="c"></span>
421 <span class="c">/**</span>
422 <span class="c"> * @property constructor</span>
423 <span class="c"> * @description Object reference to the menu item&#39;s constructor function.</span>
424 <span class="c"> * @default YAHOO.widget.MenuItem</span>
425 <span class="c"> * @type YAHOO.widget.MenuItem</span>
426 <span class="c"> */</span>
427 <span class="nx">constructor</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">MenuItem</span><span class="o">,</span>
430 <span class="c">/**</span>
431 <span class="c"> * @property imageRoot</span>
432 <span class="c"> * @description String representing the root path for all of the menu </span>
433 <span class="c"> * item&#39;s images.</span>
434 <span class="c"> * @type String</span>
435 <span class="c"> * @deprecated All menu item images are now applied via CSS </span>
436 <span class="c"> * background images.</span>
437 <span class="c"> */</span>
438 <span class="nx">imageRoot</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
441 <span class="c">/**</span>
442 <span class="c"> * @property isSecure</span>
443 <span class="c"> * @description Boolean representing whether or not the current browsing </span>
444 <span class="c"> * context is secure (HTTPS).</span>
445 <span class="c"> * @type Boolean</span>
446 <span class="c"> * @deprecated All menu item images are now applied via CSS </span>
447 <span class="c"> * background images.</span>
448 <span class="c"> */</span>
449 <span class="nx">isSecure</span><span class="o">:</span> <span class="nx">Module</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">isSecure</span><span class="o">,</span>
452 <span class="c">/**</span>
453 <span class="c"> * @property index</span>
454 <span class="c"> * @description Number indicating the ordinal position of the menu item in </span>
455 <span class="c"> * its group.</span>
456 <span class="c"> * @default null</span>
457 <span class="c"> * @type Number</span>
458 <span class="c"> */</span>
459 <span class="nx">index</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
462 <span class="c">/**</span>
463 <span class="c"> * @property groupIndex</span>
464 <span class="c"> * @description Number indicating the index of the group to which the menu </span>
465 <span class="c"> * item belongs.</span>
466 <span class="c"> * @default null</span>
467 <span class="c"> * @type Number</span>
468 <span class="c"> */</span>
469 <span class="nx">groupIndex</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
472 <span class="c">/**</span>
473 <span class="c"> * @property parent</span>
474 <span class="c"> * @description Object reference to the menu item&#39;s parent menu.</span>
475 <span class="c"> * @default null</span>
476 <span class="c"> * @type YAHOO.widget.Menu</span>
477 <span class="c"> */</span>
478 <span class="nx">parent</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
481 <span class="c">/**</span>
482 <span class="c"> * @property element</span>
483 <span class="c"> * @description Object reference to the menu item&#39;s </span>
484 <span class="c"> * &lt;code&gt;&amp;#60;li&amp;#62;&lt;/code&gt; element.</span>
485 <span class="c"> * @default &lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level</span>
486 <span class="c"> * -one-html.html#ID-74680021&quot;&gt;HTMLLIElement&lt;/a&gt;</span>
487 <span class="c"> * @type &lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-</span>
488 <span class="c"> * one-html.html#ID-74680021&quot;&gt;HTMLLIElement&lt;/a&gt;</span>
489 <span class="c"> */</span>
490 <span class="nx">element</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
493 <span class="c">/**</span>
494 <span class="c"> * @property srcElement</span>
495 <span class="c"> * @description Object reference to the HTML element (either </span>
496 <span class="c"> * &lt;code&gt;&amp;#60;li&amp;#62;&lt;/code&gt;, &lt;code&gt;&amp;#60;optgroup&amp;#62;&lt;/code&gt; or </span>
497 <span class="c"> * &lt;code&gt;&amp;#60;option&amp;#62;&lt;/code&gt;) used create the menu item.</span>
498 <span class="c"> * @default &lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/</span>
499 <span class="c"> * level-one-html.html#ID-74680021&quot;&gt;HTMLLIElement&lt;/a&gt;|&lt;a href=&quot;http://www.</span>
500 <span class="c"> * w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-38450247&quot;</span>
501 <span class="c"> * &gt;HTMLOptGroupElement&lt;/a&gt;|&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-</span>
502 <span class="c"> * Level-1-20000929/level-one-html.html#ID-70901257&quot;&gt;HTMLOptionElement&lt;/a&gt;</span>
503 <span class="c"> * @type &lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-</span>
504 <span class="c"> * one-html.html#ID-74680021&quot;&gt;HTMLLIElement&lt;/a&gt;|&lt;a href=&quot;http://www.w3.</span>
505 <span class="c"> * org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-38450247&quot;&gt;</span>
506 <span class="c"> * HTMLOptGroupElement&lt;/a&gt;|&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-</span>
507 <span class="c"> * Level-1-20000929/level-one-html.html#ID-70901257&quot;&gt;HTMLOptionElement&lt;/a&gt;</span>
508 <span class="c"> */</span>
509 <span class="nx">srcElement</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
512 <span class="c">/**</span>
513 <span class="c"> * @property value</span>
514 <span class="c"> * @description Object reference to the menu item&#39;s value.</span>
515 <span class="c"> * @default null</span>
516 <span class="c"> * @type Object</span>
517 <span class="c"> */</span>
518 <span class="nx">value</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
521 <span class="c">/**</span>
522 <span class="c"> * @property submenuIndicator</span>
523 <span class="c"> * @description Object reference to the &lt;code&gt;&amp;#60;em&amp;#62;&lt;/code&gt; element </span>
524 <span class="c"> * used to create the submenu indicator for the menu item.</span>
525 <span class="c"> * @default &lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/</span>
526 <span class="c"> * level-one-html.html#ID-58190037&quot;&gt;HTMLElement&lt;/a&gt;</span>
527 <span class="c"> * @type &lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/</span>
528 <span class="c"> * level-one-html.html#ID-58190037&quot;&gt;HTMLElement&lt;/a&gt;</span>
529 <span class="c"> */</span>
530 <span class="nx">submenuIndicator</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
533 <span class="c">/**</span>
534 <span class="c"> * @property browser</span>
535 <span class="c"> * @description String representing the browser.</span>
536 <span class="c"> * @type String</span>
537 <span class="c"> */</span>
538 <span class="nx">browser</span><span class="o">:</span> <span class="nx">Module</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">browser</span><span class="o">,</span>
541 <span class="c">/**</span>
542 <span class="c"> * @property id</span>
543 <span class="c"> * @description Id of the menu item&#39;s root &lt;code&gt;&amp;#60;li&amp;#62;&lt;/code&gt; </span>
544 <span class="c"> * element. This property should be set via the constructor using the </span>
545 <span class="c"> * configuration object literal. If an id is not specified, then one will </span>
546 <span class="c"> * be created using the &quot;generateId&quot; method of the Dom utility.</span>
547 <span class="c"> * @default null</span>
548 <span class="c"> * @type String</span>
549 <span class="c"> */</span>
550 <span class="nx">id</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
554 <span class="c">// Events</span>
555 <span class="c"></span>
557 <span class="c">/**</span>
558 <span class="c"> * @event destroyEvent</span>
559 <span class="c"> * @description Fires when the menu item&#39;s &lt;code&gt;&amp;#60;li&amp;#62;&lt;/code&gt; </span>
560 <span class="c"> * element is removed from its parent &lt;code&gt;&amp;#60;ul&amp;#62;&lt;/code&gt; element.</span>
561 <span class="c"> * @type YAHOO.util.CustomEvent</span>
562 <span class="c"> */</span>
563 <span class="nx">destroyEvent</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
566 <span class="c">/**</span>
567 <span class="c"> * @event mouseOverEvent</span>
568 <span class="c"> * @description Fires when the mouse has entered the menu item. Passes </span>
569 <span class="c"> * back the DOM Event object as an argument.</span>
570 <span class="c"> * @type YAHOO.util.CustomEvent</span>
571 <span class="c"> */</span>
572 <span class="nx">mouseOverEvent</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
575 <span class="c">/**</span>
576 <span class="c"> * @event mouseOutEvent</span>
577 <span class="c"> * @description Fires when the mouse has left the menu item. Passes back </span>
578 <span class="c"> * the DOM Event object as an argument.</span>
579 <span class="c"> * @type YAHOO.util.CustomEvent</span>
580 <span class="c"> */</span>
581 <span class="nx">mouseOutEvent</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
584 <span class="c">/**</span>
585 <span class="c"> * @event mouseDownEvent</span>
586 <span class="c"> * @description Fires when the user mouses down on the menu item. Passes </span>
587 <span class="c"> * back the DOM Event object as an argument.</span>
588 <span class="c"> * @type YAHOO.util.CustomEvent</span>
589 <span class="c"> */</span>
590 <span class="nx">mouseDownEvent</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
593 <span class="c">/**</span>
594 <span class="c"> * @event mouseUpEvent</span>
595 <span class="c"> * @description Fires when the user releases a mouse button while the mouse </span>
596 <span class="c"> * is over the menu item. Passes back the DOM Event object as an argument.</span>
597 <span class="c"> * @type YAHOO.util.CustomEvent</span>
598 <span class="c"> */</span>
599 <span class="nx">mouseUpEvent</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
602 <span class="c">/**</span>
603 <span class="c"> * @event clickEvent</span>
604 <span class="c"> * @description Fires when the user clicks the on the menu item. Passes </span>
605 <span class="c"> * back the DOM Event object as an argument.</span>
606 <span class="c"> * @type YAHOO.util.CustomEvent</span>
607 <span class="c"> */</span>
608 <span class="nx">clickEvent</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
611 <span class="c">/**</span>
612 <span class="c"> * @event keyPressEvent</span>
613 <span class="c"> * @description Fires when the user presses an alphanumeric key when the </span>
614 <span class="c"> * menu item has focus. Passes back the DOM Event object as an argument.</span>
615 <span class="c"> * @type YAHOO.util.CustomEvent</span>
616 <span class="c"> */</span>
617 <span class="nx">keyPressEvent</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
620 <span class="c">/**</span>
621 <span class="c"> * @event keyDownEvent</span>
622 <span class="c"> * @description Fires when the user presses a key when the menu item has </span>
623 <span class="c"> * focus. Passes back the DOM Event object as an argument.</span>
624 <span class="c"> * @type YAHOO.util.CustomEvent</span>
625 <span class="c"> */</span>
626 <span class="nx">keyDownEvent</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
629 <span class="c">/**</span>
630 <span class="c"> * @event keyUpEvent</span>
631 <span class="c"> * @description Fires when the user releases a key when the menu item has </span>
632 <span class="c"> * focus. Passes back the DOM Event object as an argument.</span>
633 <span class="c"> * @type YAHOO.util.CustomEvent</span>
634 <span class="c"> */</span>
635 <span class="nx">keyUpEvent</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
638 <span class="c">/**</span>
639 <span class="c"> * @event focusEvent</span>
640 <span class="c"> * @description Fires when the menu item receives focus.</span>
641 <span class="c"> * @type YAHOO.util.CustomEvent</span>
642 <span class="c"> */</span>
643 <span class="nx">focusEvent</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
646 <span class="c">/**</span>
647 <span class="c"> * @event blurEvent</span>
648 <span class="c"> * @description Fires when the menu item loses the input focus.</span>
649 <span class="c"> * @type YAHOO.util.CustomEvent</span>
650 <span class="c"> */</span>
651 <span class="nx">blurEvent</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
654 <span class="c">/**</span>
655 <span class="c"> * @method init</span>
656 <span class="c"> * @description The MenuItem class&#39;s initialization method. This method is </span>
657 <span class="c"> * automatically called by the constructor, and sets up all DOM references </span>
658 <span class="c"> * for pre-existing markup, and creates required markup if it is not </span>
659 <span class="c"> * already present.</span>
660 <span class="c"> * @param {String} p_oObject String specifying the text of the menu item.</span>
661 <span class="c"> * @param {&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-</span>
662 <span class="c"> * one-html.html#ID-74680021&quot;&gt;HTMLLIElement&lt;/a&gt;} p_oObject Object specifying </span>
663 <span class="c"> * the &lt;code&gt;&amp;#60;li&amp;#62;&lt;/code&gt; element of the menu item.</span>
664 <span class="c"> * @param {&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-</span>
665 <span class="c"> * one-html.html#ID-38450247&quot;&gt;HTMLOptGroupElement&lt;/a&gt;} p_oObject Object </span>
666 <span class="c"> * specifying the &lt;code&gt;&amp;#60;optgroup&amp;#62;&lt;/code&gt; element of the menu item.</span>
667 <span class="c"> * @param {&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-</span>
668 <span class="c"> * one-html.html#ID-70901257&quot;&gt;HTMLOptionElement&lt;/a&gt;} p_oObject Object </span>
669 <span class="c"> * specifying the &lt;code&gt;&amp;#60;option&amp;#62;&lt;/code&gt; element of the menu item.</span>
670 <span class="c"> * @param {Object} p_oConfig Optional. Object literal specifying the </span>
671 <span class="c"> * configuration for the menu item. See configuration class documentation </span>
672 <span class="c"> * for more details.</span>
673 <span class="c"> */</span>
674 <span class="nx">init</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">p_oObject</span><span class="o">,</span> <span class="nx">p_oConfig</span><span class="o">)</span> <span class="o">{</span>
677 <span class="k">if</span><span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">SUBMENU_TYPE</span><span class="o">)</span> <span class="o">{</span>
679 <span class="k">this</span><span class="o">.</span><span class="nx">SUBMENU_TYPE</span> <span class="o">=</span> <span class="nx">Menu</span><span class="o">;</span>
681 <span class="o">}</span>
684 <span class="c">// Create the config object</span>
685 <span class="c"></span>
686 <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Config</span><span class="o">(</span><span class="k">this</span><span class="o">);</span>
688 <span class="k">this</span><span class="o">.</span><span class="nx">initDefaultConfig</span><span class="o">();</span>
690 <span class="k">var</span> <span class="nx">oConfig</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">;</span>
693 <span class="k">if</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_checkString</span><span class="o">(</span><span class="nx">p_oObject</span><span class="o">))</span> <span class="o">{</span>
695 <span class="k">this</span><span class="o">.</span><span class="nx">_createRootNodeStructure</span><span class="o">();</span>
697 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s2">&quot;text&quot;</span><span class="o">,</span> <span class="nx">p_oObject</span><span class="o">);</span>
699 <span class="o">}</span>
700 <span class="k">else</span> <span class="k">if</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_checkDOMNode</span><span class="o">(</span><span class="nx">p_oObject</span><span class="o">))</span> <span class="o">{</span>
702 <span class="nx">switch</span><span class="o">(</span><span class="nx">p_oObject</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toUpperCase</span><span class="o">())</span> <span class="o">{</span>
704 <span class="nx">case</span> <span class="s2">&quot;OPTION&quot;</span><span class="o">:</span>
706 <span class="k">this</span><span class="o">.</span><span class="nx">_createRootNodeStructure</span><span class="o">();</span>
708 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s2">&quot;text&quot;</span><span class="o">,</span> <span class="nx">p_oObject</span><span class="o">.</span><span class="nx">text</span><span class="o">);</span>
710 <span class="k">this</span><span class="o">.</span><span class="nx">srcElement</span> <span class="o">=</span> <span class="nx">p_oObject</span><span class="o">;</span>
712 <span class="k">break</span><span class="o">;</span>
714 <span class="nx">case</span> <span class="s2">&quot;OPTGROUP&quot;</span><span class="o">:</span>
716 <span class="k">this</span><span class="o">.</span><span class="nx">_createRootNodeStructure</span><span class="o">();</span>
718 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s2">&quot;text&quot;</span><span class="o">,</span> <span class="nx">p_oObject</span><span class="o">.</span><span class="k">label</span><span class="o">);</span>
720 <span class="k">this</span><span class="o">.</span><span class="nx">srcElement</span> <span class="o">=</span> <span class="nx">p_oObject</span><span class="o">;</span>
722 <span class="k">this</span><span class="o">.</span><span class="nx">_initSubTree</span><span class="o">();</span>
724 <span class="k">break</span><span class="o">;</span>
726 <span class="nx">case</span> <span class="s2">&quot;LI&quot;</span><span class="o">:</span>
728 <span class="c">// Get the anchor node (if it exists)</span>
729 <span class="c"></span>
730 <span class="k">var</span> <span class="nx">oAnchor</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getFirstElement</span><span class="o">(</span><span class="nx">p_oObject</span><span class="o">,</span> <span class="s2">&quot;A&quot;</span><span class="o">),</span>
731 <span class="nx">sURL</span> <span class="o">=</span> <span class="s2">&quot;#&quot;</span><span class="o">,</span>
732 <span class="nx">sTarget</span><span class="o">,</span>
733 <span class="nx">sText</span><span class="o">;</span>
736 <span class="c">// Capture the &quot;text&quot; and/or the &quot;URL&quot;</span>
737 <span class="c"></span>
738 <span class="k">if</span><span class="o">(</span><span class="nx">oAnchor</span><span class="o">)</span> <span class="o">{</span>
740 <span class="nx">sURL</span> <span class="o">=</span> <span class="nx">oAnchor</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s2">&quot;href&quot;</span><span class="o">);</span>
741 <span class="nx">sTarget</span> <span class="o">=</span> <span class="nx">oAnchor</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s2">&quot;target&quot;</span><span class="o">);</span>
743 <span class="k">if</span><span class="o">(</span><span class="nx">oAnchor</span><span class="o">.</span><span class="nx">innerText</span><span class="o">)</span> <span class="o">{</span>
745 <span class="nx">sText</span> <span class="o">=</span> <span class="nx">oAnchor</span><span class="o">.</span><span class="nx">innerText</span><span class="o">;</span>
747 <span class="o">}</span>
748 <span class="k">else</span> <span class="o">{</span>
750 <span class="k">var</span> <span class="nx">oRange</span> <span class="o">=</span> <span class="nx">oAnchor</span><span class="o">.</span><span class="nx">ownerDocument</span><span class="o">.</span><span class="nx">createRange</span><span class="o">();</span>
752 <span class="nx">oRange</span><span class="o">.</span><span class="nx">selectNodeContents</span><span class="o">(</span><span class="nx">oAnchor</span><span class="o">);</span>
754 <span class="nx">sText</span> <span class="o">=</span> <span class="nx">oRange</span><span class="o">.</span><span class="nx">toString</span><span class="o">();</span>
756 <span class="o">}</span>
758 <span class="o">}</span>
759 <span class="k">else</span> <span class="o">{</span>
761 <span class="k">var</span> <span class="nx">oText</span> <span class="o">=</span> <span class="nx">p_oObject</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">;</span>
763 <span class="nx">sText</span> <span class="o">=</span> <span class="nx">oText</span><span class="o">.</span><span class="nx">nodeValue</span><span class="o">;</span>
765 <span class="nx">oAnchor</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s2">&quot;a&quot;</span><span class="o">);</span>
767 <span class="nx">oAnchor</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s2">&quot;href&quot;</span><span class="o">,</span> <span class="nx">sURL</span><span class="o">);</span>
769 <span class="nx">p_oObject</span><span class="o">.</span><span class="nx">replaceChild</span><span class="o">(</span><span class="nx">oAnchor</span><span class="o">,</span> <span class="nx">oText</span><span class="o">);</span>
771 <span class="nx">oAnchor</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">oText</span><span class="o">);</span>
773 <span class="o">}</span>
776 <span class="k">this</span><span class="o">.</span><span class="nx">srcElement</span> <span class="o">=</span> <span class="nx">p_oObject</span><span class="o">;</span>
777 <span class="k">this</span><span class="o">.</span><span class="nx">element</span> <span class="o">=</span> <span class="nx">p_oObject</span><span class="o">;</span>
778 <span class="k">this</span><span class="o">.</span><span class="nx">_oAnchor</span> <span class="o">=</span> <span class="nx">oAnchor</span><span class="o">;</span>
781 <span class="c">// Check if emphasis has been applied to the MenuItem</span>
782 <span class="c"></span>
783 <span class="k">var</span> <span class="nx">oEmphasisNode</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getFirstElement</span><span class="o">(</span><span class="nx">oAnchor</span><span class="o">),</span>
784 <span class="nx">bEmphasis</span> <span class="o">=</span> <span class="kc">false</span><span class="o">,</span>
785 <span class="nx">bStrongEmphasis</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
787 <span class="k">if</span><span class="o">(</span><span class="nx">oEmphasisNode</span><span class="o">)</span> <span class="o">{</span>
789 <span class="c">// Set a reference to the text node </span>
790 <span class="c"></span>
791 <span class="k">this</span><span class="o">.</span><span class="nx">_oText</span> <span class="o">=</span> <span class="nx">oEmphasisNode</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">;</span>
793 <span class="nx">switch</span><span class="o">(</span><span class="nx">oEmphasisNode</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toUpperCase</span><span class="o">())</span> <span class="o">{</span>
795 <span class="nx">case</span> <span class="s2">&quot;EM&quot;</span><span class="o">:</span>
797 <span class="nx">bEmphasis</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
799 <span class="k">break</span><span class="o">;</span>
801 <span class="nx">case</span> <span class="s2">&quot;STRONG&quot;</span><span class="o">:</span>
803 <span class="nx">bStrongEmphasis</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
805 <span class="k">break</span><span class="o">;</span>
807 <span class="o">}</span>
809 <span class="o">}</span>
810 <span class="k">else</span> <span class="o">{</span>
812 <span class="c">// Set a reference to the text node </span>
813 <span class="c"></span>
814 <span class="k">this</span><span class="o">.</span><span class="nx">_oText</span> <span class="o">=</span> <span class="nx">oAnchor</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">;</span>
816 <span class="o">}</span>
819 <span class="c">/*</span>
820 <span class="c"> Set these properties silently to sync up the </span>
821 <span class="c"> configuration object without making changes to the </span>
822 <span class="c"> element&#39;s DOM</span>
823 <span class="c"> */</span>
825 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s2">&quot;text&quot;</span><span class="o">,</span> <span class="nx">sText</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
826 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s2">&quot;url&quot;</span><span class="o">,</span> <span class="nx">sURL</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
827 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s2">&quot;target&quot;</span><span class="o">,</span> <span class="nx">sTarget</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
828 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s2">&quot;emphasis&quot;</span><span class="o">,</span> <span class="nx">bEmphasis</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
829 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span>
830 <span class="s2">&quot;strongemphasis&quot;</span><span class="o">,</span>
831 <span class="nx">bStrongEmphasis</span><span class="o">,</span>
832 <span class="kc">true</span>
833 <span class="o">);</span>
835 <span class="k">this</span><span class="o">.</span><span class="nx">_initSubTree</span><span class="o">();</span>
837 <span class="k">break</span><span class="o">;</span>
839 <span class="o">}</span>
841 <span class="o">}</span>
844 <span class="k">if</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">)</span> <span class="o">{</span>
846 <span class="k">var</span> <span class="nx">sId</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">id</span><span class="o">;</span>
848 <span class="k">if</span><span class="o">(!</span><span class="nx">sId</span><span class="o">)</span> <span class="o">{</span>
850 <span class="nx">sId</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">id</span> <span class="o">||</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">generateId</span><span class="o">();</span>
852 <span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">sId</span><span class="o">;</span>
854 <span class="o">}</span>
856 <span class="k">this</span><span class="o">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">sId</span><span class="o">;</span>
859 <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">CSS_CLASS_NAME</span><span class="o">);</span>
862 <span class="c">// Create custom events</span>
863 <span class="c"></span>
864 <span class="k">var</span> <span class="nx">CustomEvent</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">CustomEvent</span><span class="o">;</span>
866 <span class="k">this</span><span class="o">.</span><span class="nx">destroyEvent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">CustomEvent</span><span class="o">(</span><span class="s2">&quot;destroyEvent&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
867 <span class="k">this</span><span class="o">.</span><span class="nx">mouseOverEvent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">CustomEvent</span><span class="o">(</span><span class="s2">&quot;mouseOverEvent&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
868 <span class="k">this</span><span class="o">.</span><span class="nx">mouseOutEvent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">CustomEvent</span><span class="o">(</span><span class="s2">&quot;mouseOutEvent&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
869 <span class="k">this</span><span class="o">.</span><span class="nx">mouseDownEvent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">CustomEvent</span><span class="o">(</span><span class="s2">&quot;mouseDownEvent&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
870 <span class="k">this</span><span class="o">.</span><span class="nx">mouseUpEvent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">CustomEvent</span><span class="o">(</span><span class="s2">&quot;mouseUpEvent&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
871 <span class="k">this</span><span class="o">.</span><span class="nx">clickEvent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">CustomEvent</span><span class="o">(</span><span class="s2">&quot;clickEvent&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
872 <span class="k">this</span><span class="o">.</span><span class="nx">keyPressEvent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">CustomEvent</span><span class="o">(</span><span class="s2">&quot;keyPressEvent&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
873 <span class="k">this</span><span class="o">.</span><span class="nx">keyDownEvent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">CustomEvent</span><span class="o">(</span><span class="s2">&quot;keyDownEvent&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
874 <span class="k">this</span><span class="o">.</span><span class="nx">keyUpEvent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">CustomEvent</span><span class="o">(</span><span class="s2">&quot;keyUpEvent&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
875 <span class="k">this</span><span class="o">.</span><span class="nx">focusEvent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">CustomEvent</span><span class="o">(</span><span class="s2">&quot;focusEvent&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
876 <span class="k">this</span><span class="o">.</span><span class="nx">blurEvent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">CustomEvent</span><span class="o">(</span><span class="s2">&quot;blurEvent&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
879 <span class="k">if</span><span class="o">(</span><span class="nx">p_oConfig</span><span class="o">)</span> <span class="o">{</span>
881 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">applyConfig</span><span class="o">(</span><span class="nx">p_oConfig</span><span class="o">);</span>
883 <span class="o">}</span>
885 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">fireQueue</span><span class="o">();</span>
890 <span class="o">}</span>
892 <span class="o">},</span>
896 <span class="c">// Private methods</span>
897 <span class="c"></span>
899 <span class="c">/**</span>
900 <span class="c"> * @method _getFirstElement</span>
901 <span class="c"> * @description Returns an HTML element&#39;s first HTML element node.</span>
902 <span class="c"> * @private</span>
903 <span class="c"> * @param {&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/</span>
904 <span class="c"> * level-one-html.html#ID-58190037&quot;&gt;HTMLElement&lt;/a&gt;} p_oElement Object </span>
905 <span class="c"> * reference specifying the element to be evaluated.</span>
906 <span class="c"> * @param {String} p_sTagName Optional. String specifying the tagname of </span>
907 <span class="c"> * the element to be retrieved.</span>
908 <span class="c"> * @return {&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/</span>
909 <span class="c"> * level-one-html.html#ID-58190037&quot;&gt;HTMLElement&lt;/a&gt;}</span>
910 <span class="c"> */</span>
911 <span class="nx">_getFirstElement</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">p_oElement</span><span class="o">,</span> <span class="nx">p_sTagName</span><span class="o">)</span> <span class="o">{</span>
913 <span class="k">var</span> <span class="nx">oFirstChild</span> <span class="o">=</span> <span class="nx">p_oElement</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">,</span>
914 <span class="nx">oElement</span><span class="o">;</span>
916 <span class="k">if</span><span class="o">(</span><span class="nx">oFirstChild</span><span class="o">)</span> <span class="o">{</span>
918 <span class="k">if</span><span class="o">(</span><span class="nx">oFirstChild</span><span class="o">.</span><span class="nx">nodeType</span> <span class="o">==</span> <span class="m">1</span><span class="o">)</span> <span class="o">{</span>
920 <span class="nx">oElement</span> <span class="o">=</span> <span class="nx">oFirstChild</span><span class="o">;</span>
922 <span class="o">}</span>
923 <span class="k">else</span> <span class="o">{</span>
925 <span class="k">var</span> <span class="nx">oNextSibling</span> <span class="o">=</span> <span class="nx">oFirstChild</span><span class="o">.</span><span class="nx">nextSibling</span><span class="o">;</span>
927 <span class="k">if</span><span class="o">(</span><span class="nx">oNextSibling</span> <span class="o">&amp;&amp;</span> <span class="nx">oNextSibling</span><span class="o">.</span><span class="nx">nodeType</span> <span class="o">==</span> <span class="m">1</span><span class="o">)</span> <span class="o">{</span>
929 <span class="nx">oElement</span> <span class="o">=</span> <span class="nx">oNextSibling</span><span class="o">;</span>
931 <span class="o">}</span>
933 <span class="o">}</span>
935 <span class="o">}</span>
938 <span class="k">if</span><span class="o">(</span><span class="nx">p_sTagName</span><span class="o">)</span> <span class="o">{</span>
940 <span class="k">return</span> <span class="o">(</span><span class="nx">oElement</span> <span class="o">&amp;&amp;</span> <span class="nx">oElement</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toUpperCase</span><span class="o">()</span> <span class="o">==</span> <span class="nx">p_sTagName</span><span class="o">)</span> <span class="o">?</span>
941 <span class="nx">oElement</span> <span class="o">:</span> <span class="kc">false</span><span class="o">;</span>
943 <span class="o">}</span>
945 <span class="k">return</span> <span class="nx">oElement</span><span class="o">;</span>
947 <span class="o">},</span>
950 <span class="c">/**</span>
951 <span class="c"> * @method _checkString</span>
952 <span class="c"> * @description Determines if an object is a string.</span>
953 <span class="c"> * @private</span>
954 <span class="c"> * @param {Object} p_oObject Object to be evaluated.</span>
955 <span class="c"> * @return {Boolean}</span>
956 <span class="c"> */</span>
957 <span class="nx">_checkString</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">p_oObject</span><span class="o">)</span> <span class="o">{</span>
959 <span class="k">return</span> <span class="o">(</span><span class="k">typeof</span> <span class="nx">p_oObject</span> <span class="o">==</span> <span class="s2">&quot;string&quot;</span><span class="o">);</span>
961 <span class="o">},</span>
964 <span class="c">/**</span>
965 <span class="c"> * @method _checkDOMNode</span>
966 <span class="c"> * @description Determines if an object is an HTML element.</span>
967 <span class="c"> * @private</span>
968 <span class="c"> * @param {Object} p_oObject Object to be evaluated.</span>
969 <span class="c"> * @return {Boolean}</span>
970 <span class="c"> */</span>
971 <span class="nx">_checkDOMNode</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">p_oObject</span><span class="o">)</span> <span class="o">{</span>
973 <span class="k">return</span> <span class="o">(</span><span class="nx">p_oObject</span> <span class="o">&amp;&amp;</span> <span class="nx">p_oObject</span><span class="o">.</span><span class="nx">tagName</span><span class="o">);</span>
975 <span class="o">},</span>
978 <span class="c">/**</span>
979 <span class="c"> * @method _createRootNodeStructure</span>
980 <span class="c"> * @description Creates the core DOM structure for the menu item.</span>
981 <span class="c"> * @private</span>
982 <span class="c"> */</span>
983 <span class="nx">_createRootNodeStructure</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>
985 <span class="k">if</span><span class="o">(!</span><span class="nx">m_oMenuItemElement</span><span class="o">)</span> <span class="o">{</span>
987 <span class="nx">m_oMenuItemElement</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s2">&quot;li&quot;</span><span class="o">);</span>
988 <span class="nx">m_oMenuItemElement</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s2">&quot;&lt;a href=\&quot;#\&quot;&gt;s&lt;/a&gt;&quot;</span><span class="o">;</span>
990 <span class="o">}</span>
992 <span class="k">this</span><span class="o">.</span><span class="nx">element</span> <span class="o">=</span> <span class="nx">m_oMenuItemElement</span><span class="o">.</span><span class="nx">cloneNode</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
993 <span class="k">this</span><span class="o">.</span><span class="nx">_oAnchor</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">;</span>
994 <span class="k">this</span><span class="o">.</span><span class="nx">_oText</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_oAnchor</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">;</span>
996 <span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_oAnchor</span><span class="o">);</span>
998 <span class="o">},</span>
1001 <span class="c">/**</span>
1002 <span class="c"> * @method _initSubTree</span>
1003 <span class="c"> * @description Iterates the source element&#39;s childNodes collection and uses </span>
1004 <span class="c"> * the child nodes to instantiate other menus.</span>
1005 <span class="c"> * @private</span>
1006 <span class="c"> */</span>
1007 <span class="nx">_initSubTree</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
1009 <span class="k">var</span> <span class="nx">oSrcEl</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">srcElement</span><span class="o">,</span>
1010 <span class="nx">oConfig</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">;</span>
1013 <span class="k">if</span><span class="o">(</span><span class="nx">oSrcEl</span><span class="o">.</span><span class="nx">childNodes</span><span class="o">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
1015 <span class="k">if</span><span class="o">(</span>
1016 <span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">lazyLoad</span> <span class="o">&amp;&amp;</span>
1017 <span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">srcElement</span> <span class="o">&amp;&amp;</span>
1018 <span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">srcElement</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toUpperCase</span><span class="o">()</span> <span class="o">==</span> <span class="s2">&quot;SELECT&quot;</span>
1019 <span class="o">)</span> <span class="o">{</span>
1021 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span>
1022 <span class="s2">&quot;submenu&quot;</span><span class="o">,</span>
1023 <span class="o">{</span> <span class="nx">id</span><span class="o">:</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">generateId</span><span class="o">(),</span> <span class="nx">itemdata</span><span class="o">:</span> <span class="nx">oSrcEl</span><span class="o">.</span><span class="nx">childNodes</span> <span class="o">}</span>
1024 <span class="o">);</span>
1026 <span class="o">}</span>
1027 <span class="k">else</span> <span class="o">{</span>
1029 <span class="k">var</span> <span class="nx">oNode</span> <span class="o">=</span> <span class="nx">oSrcEl</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">,</span>
1030 <span class="nx">aOptions</span> <span class="o">=</span> <span class="o">[];</span>
1032 <span class="k">do</span> <span class="o">{</span>
1034 <span class="k">if</span><span class="o">(</span><span class="nx">oNode</span> <span class="o">&amp;&amp;</span> <span class="nx">oNode</span><span class="o">.</span><span class="nx">tagName</span><span class="o">)</span> <span class="o">{</span>
1036 <span class="nx">switch</span><span class="o">(</span><span class="nx">oNode</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toUpperCase</span><span class="o">())</span> <span class="o">{</span>
1038 <span class="nx">case</span> <span class="s2">&quot;DIV&quot;</span><span class="o">:</span>
1040 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s2">&quot;submenu&quot;</span><span class="o">,</span> <span class="nx">oNode</span><span class="o">);</span>
1042 <span class="k">break</span><span class="o">;</span>
1044 <span class="nx">case</span> <span class="s2">&quot;OPTION&quot;</span><span class="o">:</span>
1046 <span class="nx">aOptions</span><span class="o">[</span><span class="nx">aOptions</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">oNode</span><span class="o">;</span>
1048 <span class="k">break</span><span class="o">;</span>
1050 <span class="o">}</span>
1052 <span class="o">}</span>
1054 <span class="o">}</span>
1055 <span class="k">while</span><span class="o">((</span><span class="nx">oNode</span> <span class="o">=</span> <span class="nx">oNode</span><span class="o">.</span><span class="nx">nextSibling</span><span class="o">));</span>
1058 <span class="k">var</span> <span class="nx">nOptions</span> <span class="o">=</span> <span class="nx">aOptions</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>
1060 <span class="k">if</span><span class="o">(</span><span class="nx">nOptions</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
1062 <span class="k">var</span> <span class="nx">oMenu</span> <span class="o">=</span> <span class="k">new</span> <span class="k">this</span><span class="o">.</span><span class="nx">SUBMENU_TYPE</span><span class="o">(</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">generateId</span><span class="o">());</span>
1064 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s2">&quot;submenu&quot;</span><span class="o">,</span> <span class="nx">oMenu</span><span class="o">);</span>
1066 <span class="k">for</span><span class="o">(</span><span class="k">var</span> <span class="nx">n</span><span class="o">=</span><span class="m">0</span><span class="o">;</span> <span class="nx">n</span><span class="o">&lt;</span><span class="nx">nOptions</span><span class="o">;</span> <span class="nx">n</span><span class="o">++)</span> <span class="o">{</span>
1068 <span class="nx">oMenu</span><span class="o">.</span><span class="nx">addItem</span><span class="o">((</span><span class="k">new</span> <span class="nx">oMenu</span><span class="o">.</span><span class="nx">ITEM_TYPE</span><span class="o">(</span><span class="nx">aOptions</span><span class="o">[</span><span class="nx">n</span><span class="o">])));</span>
1070 <span class="o">}</span>
1072 <span class="o">}</span>
1074 <span class="o">}</span>
1076 <span class="o">}</span>
1078 <span class="o">},</span>
1081 <span class="c">/**</span>
1082 <span class="c"> * @method _preloadImage</span>
1083 <span class="c"> * @description Preloads an image by creating an image element from the </span>
1084 <span class="c"> * specified path and appending the image to the body of the document.</span>
1085 <span class="c"> * @private</span>
1086 <span class="c"> * @param {String} p_sPath String specifying the path to the image. </span>
1087 <span class="c"> * @deprecated All menu item images are now applied via CSS </span>
1088 <span class="c"> * background images.</span>
1089 <span class="c"> */</span>
1090 <span class="nx">_preloadImage</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">p_sPath</span><span class="o">)</span> <span class="o">{</span>
1092 <span class="k">var</span> <span class="nx">sPath</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">imageRoot</span> <span class="o">+</span> <span class="nx">p_sPath</span><span class="o">;</span>
1094 <span class="k">if</span><span class="o">(!</span><span class="nb">document</span><span class="o">.</span><span class="nx">images</span><span class="o">[</span><span class="nx">sPath</span><span class="o">])</span> <span class="o">{</span>
1096 <span class="k">var</span> <span class="nx">oImage</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s2">&quot;img&quot;</span><span class="o">);</span>
1097 <span class="nx">oImage</span><span class="o">.</span><span class="nx">src</span> <span class="o">=</span> <span class="nx">sPath</span><span class="o">;</span>
1098 <span class="nx">oImage</span><span class="o">.</span><span class="nx">name</span> <span class="o">=</span> <span class="nx">sPath</span><span class="o">;</span>
1099 <span class="nx">oImage</span><span class="o">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">sPath</span><span class="o">;</span>
1100 <span class="nx">oImage</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;none&quot;</span><span class="o">;</span>
1102 <span class="nb">document</span><span class="o">.</span><span class="nx">body</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">oImage</span><span class="o">);</span>
1104 <span class="o">}</span>
1106 <span class="o">},</span>
1110 <span class="c">// Event handlers for configuration properties</span>
1111 <span class="c"></span>
1113 <span class="c">/**</span>
1114 <span class="c"> * @method configText</span>
1115 <span class="c"> * @description Event handler for when the &quot;text&quot; configuration property of </span>
1116 <span class="c"> * the menu item changes.</span>
1117 <span class="c"> * @param {String} p_sType String representing the name of the event that </span>
1118 <span class="c"> * was fired.</span>
1119 <span class="c"> * @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
1120 <span class="c"> * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item</span>
1121 <span class="c"> * that fired the event.</span>
1122 <span class="c"> */</span>
1123 <span class="nx">configText</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">)</span> <span class="o">{</span>
1125 <span class="k">var</span> <span class="nx">sText</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
1128 <span class="k">if</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_oText</span><span class="o">)</span> <span class="o">{</span>
1130 <span class="k">this</span><span class="o">.</span><span class="nx">_oText</span><span class="o">.</span><span class="nx">nodeValue</span> <span class="o">=</span> <span class="nx">sText</span><span class="o">;</span>
1132 <span class="o">}</span>
1134 <span class="o">},</span>
1137 <span class="c">/**</span>
1138 <span class="c"> * @method configHelpText</span>
1139 <span class="c"> * @description Event handler for when the &quot;helptext&quot; configuration property </span>
1140 <span class="c"> * of the menu item changes.</span>
1141 <span class="c"> * @param {String} p_sType String representing the name of the event that </span>
1142 <span class="c"> * was fired.</span>
1143 <span class="c"> * @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
1144 <span class="c"> * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item</span>
1145 <span class="c"> * that fired the event.</span>
1146 <span class="c"> */</span>
1147 <span class="nx">configHelpText</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">)</span> <span class="o">{</span>
1149 <span class="k">var</span> <span class="nx">me</span> <span class="o">=</span> <span class="k">this</span><span class="o">,</span>
1150 <span class="nx">oHelpText</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">],</span>
1151 <span class="nx">oEl</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span>
1152 <span class="nx">oConfig</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">,</span>
1153 <span class="nx">aNodes</span> <span class="o">=</span> <span class="o">[</span><span class="nx">oEl</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_oAnchor</span><span class="o">],</span>
1154 <span class="nx">oSubmenuIndicator</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">submenuIndicator</span><span class="o">;</span>
1157 <span class="k">function</span> <span class="nx">initHelpText</span><span class="o">()</span> <span class="o">{</span>
1159 <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">aNodes</span><span class="o">,</span> <span class="s2">&quot;hashelptext&quot;</span><span class="o">);</span>
1161 <span class="k">if</span><span class="o">(</span><span class="nx">oConfig</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;disabled&quot;</span><span class="o">))</span> <span class="o">{</span>
1163 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">refireEvent</span><span class="o">(</span><span class="s2">&quot;disabled&quot;</span><span class="o">);</span>
1165 <span class="o">}</span>
1167 <span class="k">if</span><span class="o">(</span><span class="nx">oConfig</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;selected&quot;</span><span class="o">))</span> <span class="o">{</span>
1169 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">refireEvent</span><span class="o">(</span><span class="s2">&quot;selected&quot;</span><span class="o">);</span>
1171 <span class="o">}</span>
1173 <span class="o">}</span>
1176 <span class="k">function</span> <span class="nx">removeHelpText</span><span class="o">()</span> <span class="o">{</span>
1178 <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="nx">aNodes</span><span class="o">,</span> <span class="s2">&quot;hashelptext&quot;</span><span class="o">);</span>
1180 <span class="nx">oEl</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="nx">me</span><span class="o">.</span><span class="nx">_oHelpTextEM</span><span class="o">);</span>
1181 <span class="nx">me</span><span class="o">.</span><span class="nx">_oHelpTextEM</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
1183 <span class="o">}</span>
1186 <span class="k">if</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_checkDOMNode</span><span class="o">(</span><span class="nx">oHelpText</span><span class="o">))</span> <span class="o">{</span>
1188 <span class="nx">oHelpText</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s2">&quot;helptext&quot;</span><span class="o">;</span>
1190 <span class="k">if</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_oHelpTextEM</span><span class="o">)</span> <span class="o">{</span>
1192 <span class="k">this</span><span class="o">.</span><span class="nx">_oHelpTextEM</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">replaceChild</span><span class="o">(</span>
1193 <span class="nx">oHelpText</span><span class="o">,</span>
1194 <span class="k">this</span><span class="o">.</span><span class="nx">_oHelpTextEM</span>
1195 <span class="o">);</span>
1197 <span class="o">}</span>
1198 <span class="k">else</span> <span class="o">{</span>
1200 <span class="k">this</span><span class="o">.</span><span class="nx">_oHelpTextEM</span> <span class="o">=</span> <span class="nx">oHelpText</span><span class="o">;</span>
1202 <span class="nx">oEl</span><span class="o">.</span><span class="nx">insertBefore</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_oHelpTextEM</span><span class="o">,</span> <span class="nx">oSubmenuIndicator</span><span class="o">);</span>
1204 <span class="o">}</span>
1206 <span class="nx">initHelpText</span><span class="o">();</span>
1208 <span class="o">}</span>
1209 <span class="k">else</span> <span class="k">if</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_checkString</span><span class="o">(</span><span class="nx">oHelpText</span><span class="o">))</span> <span class="o">{</span>
1211 <span class="k">if</span><span class="o">(</span><span class="nx">oHelpText</span><span class="o">.</span><span class="nx">length</span> <span class="o">===</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
1213 <span class="nx">removeHelpText</span><span class="o">();</span>
1215 <span class="o">}</span>
1216 <span class="k">else</span> <span class="o">{</span>
1218 <span class="k">if</span><span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_oHelpTextEM</span><span class="o">)</span> <span class="o">{</span>
1220 <span class="k">this</span><span class="o">.</span><span class="nx">_oHelpTextEM</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s2">&quot;em&quot;</span><span class="o">);</span>
1221 <span class="k">this</span><span class="o">.</span><span class="nx">_oHelpTextEM</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s2">&quot;helptext&quot;</span><span class="o">;</span>
1223 <span class="nx">oEl</span><span class="o">.</span><span class="nx">insertBefore</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_oHelpTextEM</span><span class="o">,</span> <span class="nx">oSubmenuIndicator</span><span class="o">);</span>
1225 <span class="o">}</span>
1227 <span class="k">this</span><span class="o">.</span><span class="nx">_oHelpTextEM</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">oHelpText</span><span class="o">;</span>
1229 <span class="nx">initHelpText</span><span class="o">();</span>
1231 <span class="o">}</span>
1233 <span class="o">}</span>
1234 <span class="k">else</span> <span class="k">if</span><span class="o">(!</span><span class="nx">oHelpText</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_oHelpTextEM</span><span class="o">)</span> <span class="o">{</span>
1236 <span class="nx">removeHelpText</span><span class="o">();</span>
1238 <span class="o">}</span>
1240 <span class="o">},</span>
1243 <span class="c">/**</span>
1244 <span class="c"> * @method configURL</span>
1245 <span class="c"> * @description Event handler for when the &quot;url&quot; configuration property of </span>
1246 <span class="c"> * the menu item changes.</span>
1247 <span class="c"> * @param {String} p_sType String representing the name of the event that </span>
1248 <span class="c"> * was fired.</span>
1249 <span class="c"> * @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
1250 <span class="c"> * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item</span>
1251 <span class="c"> * that fired the event.</span>
1252 <span class="c"> */</span>
1253 <span class="nx">configURL</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">)</span> <span class="o">{</span>
1255 <span class="k">var</span> <span class="nx">sURL</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
1257 <span class="k">if</span><span class="o">(!</span><span class="nx">sURL</span><span class="o">)</span> <span class="o">{</span>
1259 <span class="nx">sURL</span> <span class="o">=</span> <span class="s2">&quot;#&quot;</span><span class="o">;</span>
1261 <span class="o">}</span>
1263 <span class="k">this</span><span class="o">.</span><span class="nx">_oAnchor</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s2">&quot;href&quot;</span><span class="o">,</span> <span class="nx">sURL</span><span class="o">);</span>
1265 <span class="o">},</span>
1268 <span class="c">/**</span>
1269 <span class="c"> * @method configTarget</span>
1270 <span class="c"> * @description Event handler for when the &quot;target&quot; configuration property </span>
1271 <span class="c"> * of the menu item changes. </span>
1272 <span class="c"> * @param {String} p_sType String representing the name of the event that </span>
1273 <span class="c"> * was fired.</span>
1274 <span class="c"> * @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
1275 <span class="c"> * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item</span>
1276 <span class="c"> * that fired the event.</span>
1277 <span class="c"> */</span>
1278 <span class="nx">configTarget</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">)</span> <span class="o">{</span>
1280 <span class="k">var</span> <span class="nx">sTarget</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">],</span>
1281 <span class="nx">oAnchor</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_oAnchor</span><span class="o">;</span>
1283 <span class="k">if</span><span class="o">(</span><span class="nx">sTarget</span> <span class="o">&amp;&amp;</span> <span class="nx">sTarget</span><span class="o">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
1285 <span class="nx">oAnchor</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s2">&quot;target&quot;</span><span class="o">,</span> <span class="nx">sTarget</span><span class="o">);</span>
1287 <span class="o">}</span>
1288 <span class="k">else</span> <span class="o">{</span>
1290 <span class="nx">oAnchor</span><span class="o">.</span><span class="nx">removeAttribute</span><span class="o">(</span><span class="s2">&quot;target&quot;</span><span class="o">);</span>
1292 <span class="o">}</span>
1294 <span class="o">},</span>
1297 <span class="c">/**</span>
1298 <span class="c"> * @method configEmphasis</span>
1299 <span class="c"> * @description Event handler for when the &quot;emphasis&quot; configuration property</span>
1300 <span class="c"> * of the menu item changes. </span>
1301 <span class="c"> * @param {String} p_sType String representing the name of the event that </span>
1302 <span class="c"> * was fired.</span>
1303 <span class="c"> * @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
1304 <span class="c"> * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item</span>
1305 <span class="c"> * that fired the event.</span>
1306 <span class="c"> */</span>
1307 <span class="nx">configEmphasis</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">)</span> <span class="o">{</span>
1309 <span class="k">var</span> <span class="nx">bEmphasis</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">],</span>
1310 <span class="nx">oAnchor</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_oAnchor</span><span class="o">,</span>
1311 <span class="nx">oText</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_oText</span><span class="o">,</span>
1312 <span class="nx">oConfig</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">,</span>
1313 <span class="nx">oEM</span><span class="o">;</span>
1316 <span class="k">if</span><span class="o">(</span><span class="nx">bEmphasis</span> <span class="o">&amp;&amp;</span> <span class="nx">oConfig</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;strongemphasis&quot;</span><span class="o">))</span> <span class="o">{</span>
1318 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s2">&quot;strongemphasis&quot;</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span>
1320 <span class="o">}</span>
1323 <span class="k">if</span><span class="o">(</span><span class="nx">oAnchor</span><span class="o">)</span> <span class="o">{</span>
1325 <span class="k">if</span><span class="o">(</span><span class="nx">bEmphasis</span><span class="o">)</span> <span class="o">{</span>
1327 <span class="nx">oEM</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s2">&quot;em&quot;</span><span class="o">);</span>
1328 <span class="nx">oEM</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">oText</span><span class="o">);</span>
1330 <span class="nx">oAnchor</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">oEM</span><span class="o">);</span>
1332 <span class="o">}</span>
1333 <span class="k">else</span> <span class="o">{</span>
1335 <span class="nx">oEM</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getFirstElement</span><span class="o">(</span><span class="nx">oAnchor</span><span class="o">,</span> <span class="s2">&quot;EM&quot;</span><span class="o">);</span>
1337 <span class="k">if</span><span class="o">(</span><span class="nx">oEM</span><span class="o">)</span> <span class="o">{</span>
1339 <span class="nx">oAnchor</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="nx">oEM</span><span class="o">);</span>
1340 <span class="nx">oAnchor</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">oText</span><span class="o">);</span>
1342 <span class="o">}</span>
1344 <span class="o">}</span>
1346 <span class="o">}</span>
1348 <span class="o">},</span>
1351 <span class="c">/**</span>
1352 <span class="c"> * @method configStrongEmphasis</span>
1353 <span class="c"> * @description Event handler for when the &quot;strongemphasis&quot; configuration </span>
1354 <span class="c"> * property of the menu item changes. </span>
1355 <span class="c"> * @param {String} p_sType String representing the name of the event that </span>
1356 <span class="c"> * was fired.</span>
1357 <span class="c"> * @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
1358 <span class="c"> * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item</span>
1359 <span class="c"> * that fired the event.</span>
1360 <span class="c"> */</span>
1361 <span class="nx">configStrongEmphasis</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">)</span> <span class="o">{</span>
1363 <span class="k">var</span> <span class="nx">bStrongEmphasis</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">],</span>
1364 <span class="nx">oAnchor</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_oAnchor</span><span class="o">,</span>
1365 <span class="nx">oText</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_oText</span><span class="o">,</span>
1366 <span class="nx">oConfig</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">,</span>
1367 <span class="nx">oStrong</span><span class="o">;</span>
1369 <span class="k">if</span><span class="o">(</span><span class="nx">bStrongEmphasis</span> <span class="o">&amp;&amp;</span> <span class="nx">oConfig</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;emphasis&quot;</span><span class="o">))</span> <span class="o">{</span>
1371 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s2">&quot;emphasis&quot;</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span>
1373 <span class="o">}</span>
1375 <span class="k">if</span><span class="o">(</span><span class="nx">oAnchor</span><span class="o">)</span> <span class="o">{</span>
1377 <span class="k">if</span><span class="o">(</span><span class="nx">bStrongEmphasis</span><span class="o">)</span> <span class="o">{</span>
1379 <span class="nx">oStrong</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s2">&quot;strong&quot;</span><span class="o">);</span>
1380 <span class="nx">oStrong</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">oText</span><span class="o">);</span>
1382 <span class="nx">oAnchor</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">oStrong</span><span class="o">);</span>
1384 <span class="o">}</span>
1385 <span class="k">else</span> <span class="o">{</span>
1387 <span class="nx">oStrong</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getFirstElement</span><span class="o">(</span><span class="nx">oAnchor</span><span class="o">,</span> <span class="s2">&quot;STRONG&quot;</span><span class="o">);</span>
1389 <span class="k">if</span><span class="o">(</span><span class="nx">oStrong</span><span class="o">)</span> <span class="o">{</span>
1391 <span class="nx">oAnchor</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="nx">oStrong</span><span class="o">);</span>
1392 <span class="nx">oAnchor</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">oText</span><span class="o">);</span>
1394 <span class="o">}</span>
1396 <span class="o">}</span>
1398 <span class="o">}</span>
1400 <span class="o">},</span>
1403 <span class="c">/**</span>
1404 <span class="c"> * @method configChecked</span>
1405 <span class="c"> * @description Event handler for when the &quot;checked&quot; configuration property </span>
1406 <span class="c"> * of the menu item changes. </span>
1407 <span class="c"> * @param {String} p_sType String representing the name of the event that </span>
1408 <span class="c"> * was fired.</span>
1409 <span class="c"> * @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
1410 <span class="c"> * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item</span>
1411 <span class="c"> * that fired the event.</span>
1412 <span class="c"> */</span>
1413 <span class="nx">configChecked</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">)</span> <span class="o">{</span>
1415 <span class="k">var</span> <span class="nx">bChecked</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">],</span>
1416 <span class="nx">oEl</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span>
1417 <span class="nx">oConfig</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">,</span>
1418 <span class="nx">oEM</span><span class="o">;</span>
1421 <span class="k">if</span><span class="o">(</span><span class="nx">bChecked</span><span class="o">)</span> <span class="o">{</span>
1423 <span class="k">if</span><span class="o">(!</span><span class="nx">m_oCheckedIndicator</span><span class="o">)</span> <span class="o">{</span>
1425 <span class="nx">m_oCheckedIndicator</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s2">&quot;em&quot;</span><span class="o">);</span>
1426 <span class="nx">m_oCheckedIndicator</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">CHECKED_TEXT</span><span class="o">;</span>
1427 <span class="nx">m_oCheckedIndicator</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s2">&quot;checkedindicator&quot;</span><span class="o">;</span>
1429 <span class="o">}</span>
1431 <span class="nx">oEM</span> <span class="o">=</span> <span class="nx">m_oCheckedIndicator</span><span class="o">.</span><span class="nx">cloneNode</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
1433 <span class="k">var</span> <span class="nx">oSubmenu</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;submenu&quot;</span><span class="o">);</span>
1435 <span class="k">if</span><span class="o">(</span><span class="nx">oSubmenu</span> <span class="o">&amp;&amp;</span> <span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">element</span><span class="o">)</span> <span class="o">{</span>
1437 <span class="nx">oEl</span><span class="o">.</span><span class="nx">insertBefore</span><span class="o">(</span><span class="nx">oEM</span><span class="o">,</span> <span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">element</span><span class="o">);</span>
1439 <span class="o">}</span>
1440 <span class="k">else</span> <span class="o">{</span>
1442 <span class="nx">oEl</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">oEM</span><span class="o">);</span>
1444 <span class="o">}</span>
1447 <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">oEl</span><span class="o">,</span> <span class="s2">&quot;checked&quot;</span><span class="o">);</span>
1449 <span class="k">this</span><span class="o">.</span><span class="nx">_oCheckedIndicator</span> <span class="o">=</span> <span class="nx">oEM</span><span class="o">;</span>
1451 <span class="k">if</span><span class="o">(</span><span class="nx">oConfig</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;disabled&quot;</span><span class="o">))</span> <span class="o">{</span>
1453 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">refireEvent</span><span class="o">(</span><span class="s2">&quot;disabled&quot;</span><span class="o">);</span>
1455 <span class="o">}</span>
1457 <span class="k">if</span><span class="o">(</span><span class="nx">oConfig</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;selected&quot;</span><span class="o">))</span> <span class="o">{</span>
1459 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">refireEvent</span><span class="o">(</span><span class="s2">&quot;selected&quot;</span><span class="o">);</span>
1461 <span class="o">}</span>
1463 <span class="o">}</span>
1464 <span class="k">else</span> <span class="o">{</span>
1466 <span class="nx">oEM</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_oCheckedIndicator</span><span class="o">;</span>
1468 <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="nx">oEl</span><span class="o">,</span> <span class="s2">&quot;checked&quot;</span><span class="o">);</span>
1470 <span class="k">if</span><span class="o">(</span><span class="nx">oEM</span><span class="o">)</span> <span class="o">{</span>
1472 <span class="nx">oEl</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="nx">oEM</span><span class="o">);</span>
1474 <span class="o">}</span>
1476 <span class="k">this</span><span class="o">.</span><span class="nx">_oCheckedIndicator</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
1478 <span class="o">}</span>
1480 <span class="o">},</span>
1484 <span class="c">/**</span>
1485 <span class="c"> * @method configDisabled</span>
1486 <span class="c"> * @description Event handler for when the &quot;disabled&quot; configuration property </span>
1487 <span class="c"> * of the menu item changes. </span>
1488 <span class="c"> * @param {String} p_sType String representing the name of the event that </span>
1489 <span class="c"> * was fired.</span>
1490 <span class="c"> * @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
1491 <span class="c"> * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item</span>
1492 <span class="c"> * that fired the event.</span>
1493 <span class="c"> */</span>
1494 <span class="nx">configDisabled</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">)</span> <span class="o">{</span>
1496 <span class="k">var</span> <span class="nx">bDisabled</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">],</span>
1497 <span class="nx">oConfig</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">,</span>
1498 <span class="nx">oAnchor</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_oAnchor</span><span class="o">,</span>
1499 <span class="nx">aNodes</span> <span class="o">=</span> <span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">oAnchor</span><span class="o">],</span>
1500 <span class="nx">oHelpText</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_oHelpTextEM</span><span class="o">,</span>
1501 <span class="nx">oCheckedIndicator</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_oCheckedIndicator</span><span class="o">,</span>
1502 <span class="nx">oSubmenuIndicator</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">submenuIndicator</span><span class="o">,</span>
1503 <span class="nx">i</span> <span class="o">=</span> <span class="m">1</span><span class="o">;</span>
1506 <span class="k">if</span><span class="o">(</span><span class="nx">oHelpText</span><span class="o">)</span> <span class="o">{</span>
1508 <span class="nx">i</span><span class="o">++;</span>
1509 <span class="nx">aNodes</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">=</span> <span class="nx">oHelpText</span><span class="o">;</span>
1511 <span class="o">}</span>
1514 <span class="k">if</span><span class="o">(</span><span class="nx">oCheckedIndicator</span><span class="o">)</span> <span class="o">{</span>
1516 <span class="nx">oCheckedIndicator</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">.</span><span class="nx">nodeValue</span> <span class="o">=</span> <span class="nx">bDisabled</span> <span class="o">?</span>
1517 <span class="k">this</span><span class="o">.</span><span class="nx">DISABLED_CHECKED_TEXT</span> <span class="o">:</span>
1518 <span class="k">this</span><span class="o">.</span><span class="nx">CHECKED_TEXT</span><span class="o">;</span>
1520 <span class="nx">i</span><span class="o">++;</span>
1521 <span class="nx">aNodes</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">=</span> <span class="nx">oCheckedIndicator</span><span class="o">;</span>
1523 <span class="o">}</span>
1526 <span class="k">if</span><span class="o">(</span><span class="nx">oSubmenuIndicator</span><span class="o">)</span> <span class="o">{</span>
1528 <span class="nx">oSubmenuIndicator</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">.</span><span class="nx">nodeValue</span> <span class="o">=</span> <span class="nx">bDisabled</span> <span class="o">?</span>
1529 <span class="k">this</span><span class="o">.</span><span class="nx">DISABLED_SUBMENU_INDICATOR_TEXT</span> <span class="o">:</span>
1530 <span class="k">this</span><span class="o">.</span><span class="nx">COLLAPSED_SUBMENU_INDICATOR_TEXT</span><span class="o">;</span>
1532 <span class="nx">i</span><span class="o">++;</span>
1533 <span class="nx">aNodes</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">=</span> <span class="nx">oSubmenuIndicator</span><span class="o">;</span>
1535 <span class="o">}</span>
1538 <span class="k">if</span><span class="o">(</span><span class="nx">bDisabled</span><span class="o">)</span> <span class="o">{</span>
1540 <span class="k">if</span><span class="o">(</span><span class="nx">oConfig</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;selected&quot;</span><span class="o">))</span> <span class="o">{</span>
1542 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s2">&quot;selected&quot;</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span>
1544 <span class="o">}</span>
1546 <span class="nx">oAnchor</span><span class="o">.</span><span class="nx">removeAttribute</span><span class="o">(</span><span class="s2">&quot;href&quot;</span><span class="o">);</span>
1548 <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">aNodes</span><span class="o">,</span> <span class="s2">&quot;disabled&quot;</span><span class="o">);</span>
1550 <span class="o">}</span>
1551 <span class="k">else</span> <span class="o">{</span>
1553 <span class="nx">oAnchor</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s2">&quot;href&quot;</span><span class="o">,</span> <span class="nx">oConfig</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;url&quot;</span><span class="o">));</span>
1555 <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="nx">aNodes</span><span class="o">,</span> <span class="s2">&quot;disabled&quot;</span><span class="o">);</span>
1557 <span class="o">}</span>
1559 <span class="o">},</span>
1562 <span class="c">/**</span>
1563 <span class="c"> * @method configSelected</span>
1564 <span class="c"> * @description Event handler for when the &quot;selected&quot; configuration property </span>
1565 <span class="c"> * of the menu item changes. </span>
1566 <span class="c"> * @param {String} p_sType String representing the name of the event that </span>
1567 <span class="c"> * was fired.</span>
1568 <span class="c"> * @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
1569 <span class="c"> * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item</span>
1570 <span class="c"> * that fired the event.</span>
1571 <span class="c"> */</span>
1572 <span class="nx">configSelected</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">)</span> <span class="o">{</span>
1574 <span class="k">if</span><span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;disabled&quot;</span><span class="o">))</span> <span class="o">{</span>
1576 <span class="k">var</span> <span class="nx">bSelected</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">],</span>
1577 <span class="nx">oHelpText</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_oHelpTextEM</span><span class="o">,</span>
1578 <span class="nx">oSubmenuIndicator</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">submenuIndicator</span><span class="o">,</span>
1579 <span class="nx">oCheckedIndicator</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_oCheckedIndicator</span><span class="o">,</span>
1580 <span class="nx">aNodes</span> <span class="o">=</span> <span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_oAnchor</span><span class="o">],</span>
1581 <span class="nx">i</span> <span class="o">=</span> <span class="m">1</span><span class="o">;</span>
1584 <span class="k">if</span><span class="o">(</span><span class="nx">oHelpText</span><span class="o">)</span> <span class="o">{</span>
1586 <span class="nx">i</span><span class="o">++;</span>
1587 <span class="nx">aNodes</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">=</span> <span class="nx">oHelpText</span><span class="o">;</span>
1589 <span class="o">}</span>
1592 <span class="k">if</span><span class="o">(</span><span class="nx">oSubmenuIndicator</span><span class="o">)</span> <span class="o">{</span>
1594 <span class="nx">i</span><span class="o">++;</span>
1595 <span class="nx">aNodes</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">=</span> <span class="nx">oSubmenuIndicator</span><span class="o">;</span>
1597 <span class="o">}</span>
1600 <span class="k">if</span><span class="o">(</span><span class="nx">oCheckedIndicator</span><span class="o">)</span> <span class="o">{</span>
1602 <span class="nx">i</span><span class="o">++;</span>
1603 <span class="nx">aNodes</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">=</span> <span class="nx">oCheckedIndicator</span><span class="o">;</span>
1605 <span class="o">}</span>
1608 <span class="k">if</span><span class="o">(</span><span class="nx">bSelected</span><span class="o">)</span> <span class="o">{</span>
1610 <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">aNodes</span><span class="o">,</span> <span class="s2">&quot;selected&quot;</span><span class="o">);</span>
1612 <span class="o">}</span>
1613 <span class="k">else</span> <span class="o">{</span>
1615 <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="nx">aNodes</span><span class="o">,</span> <span class="s2">&quot;selected&quot;</span><span class="o">);</span>
1617 <span class="o">}</span>
1619 <span class="o">}</span>
1621 <span class="o">},</span>
1624 <span class="c">/**</span>
1625 <span class="c"> * @method configSubmenu</span>
1626 <span class="c"> * @description Event handler for when the &quot;submenu&quot; configuration property </span>
1627 <span class="c"> * of the menu item changes. </span>
1628 <span class="c"> * @param {String} p_sType String representing the name of the event that </span>
1629 <span class="c"> * was fired.</span>
1630 <span class="c"> * @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
1631 <span class="c"> * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item</span>
1632 <span class="c"> * that fired the event.</span>
1633 <span class="c"> */</span>
1634 <span class="nx">configSubmenu</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">)</span> <span class="o">{</span>
1636 <span class="k">var</span> <span class="nx">oEl</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span>
1637 <span class="nx">oSubmenu</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">],</span>
1638 <span class="nx">oSubmenuIndicator</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">submenuIndicator</span><span class="o">,</span>
1639 <span class="nx">oConfig</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">,</span>
1640 <span class="nx">aNodes</span> <span class="o">=</span> <span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_oAnchor</span><span class="o">],</span>
1641 <span class="nx">bLazyLoad</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">parent</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">lazyLoad</span><span class="o">,</span>
1642 <span class="nx">oMenu</span><span class="o">;</span>
1645 <span class="k">if</span><span class="o">(</span><span class="nx">oSubmenu</span><span class="o">)</span> <span class="o">{</span>
1647 <span class="k">if</span><span class="o">(</span><span class="nx">oSubmenu</span> <span class="k">instanceof</span> <span class="nx">Menu</span><span class="o">)</span> <span class="o">{</span>
1649 <span class="nx">oMenu</span> <span class="o">=</span> <span class="nx">oSubmenu</span><span class="o">;</span>
1650 <span class="nx">oMenu</span><span class="o">.</span><span class="nx">parent</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
1651 <span class="nx">oMenu</span><span class="o">.</span><span class="nx">lazyLoad</span> <span class="o">=</span> <span class="nx">bLazyLoad</span><span class="o">;</span>
1653 <span class="o">}</span>
1654 <span class="k">else</span> <span class="k">if</span><span class="o">(</span>
1655 <span class="k">typeof</span> <span class="nx">oSubmenu</span> <span class="o">==</span> <span class="s2">&quot;object&quot;</span> <span class="o">&amp;&amp;</span>
1656 <span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">id</span> <span class="o">&amp;&amp;</span>
1657 <span class="o">!</span><span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">nodeType</span>
1658 <span class="o">)</span> <span class="o">{</span>
1660 <span class="k">var</span> <span class="nx">sSubmenuId</span> <span class="o">=</span> <span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">id</span><span class="o">,</span>
1661 <span class="nx">oSubmenuConfig</span> <span class="o">=</span> <span class="nx">oSubmenu</span><span class="o">;</span>
1663 <span class="nx">oSubmenuConfig</span><span class="o">.</span><span class="nx">lazyload</span> <span class="o">=</span> <span class="nx">bLazyLoad</span><span class="o">;</span>
1664 <span class="nx">oSubmenuConfig</span><span class="o">.</span><span class="nx">parent</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
1666 <span class="nx">oMenu</span> <span class="o">=</span> <span class="k">new</span> <span class="k">this</span><span class="o">.</span><span class="nx">SUBMENU_TYPE</span><span class="o">(</span><span class="nx">sSubmenuId</span><span class="o">,</span> <span class="nx">oSubmenuConfig</span><span class="o">);</span>
1669 <span class="c">// Set the value of the property to the Menu instance</span>
1670 <span class="c"></span>
1671 <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s2">&quot;submenu&quot;</span><span class="o">,</span> <span class="nx">oMenu</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
1673 <span class="o">}</span>
1674 <span class="k">else</span> <span class="o">{</span>
1676 <span class="nx">oMenu</span> <span class="o">=</span> <span class="k">new</span> <span class="k">this</span><span class="o">.</span><span class="nx">SUBMENU_TYPE</span><span class="o">(</span>
1677 <span class="nx">oSubmenu</span><span class="o">,</span>
1678 <span class="o">{</span> <span class="nx">lazyload</span><span class="o">:</span> <span class="nx">bLazyLoad</span><span class="o">,</span> <span class="nx">parent</span><span class="o">:</span> <span class="k">this</span> <span class="o">}</span>
1679 <span class="o">);</span>
1682 <span class="c">// Set the value of the property to the Menu instance</span>
1683 <span class="c"></span>
1684 <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s2">&quot;submenu&quot;</span><span class="o">,</span> <span class="nx">oMenu</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
1686 <span class="o">}</span>
1689 <span class="k">if</span><span class="o">(</span><span class="nx">oMenu</span><span class="o">)</span> <span class="o">{</span>
1691 <span class="k">this</span><span class="o">.</span><span class="nx">_oSubmenu</span> <span class="o">=</span> <span class="nx">oMenu</span><span class="o">;</span>
1694 <span class="k">if</span><span class="o">(!</span><span class="nx">oSubmenuIndicator</span><span class="o">)</span> <span class="o">{</span>
1697 <span class="k">if</span><span class="o">(!</span><span class="nx">m_oSubmenuIndicator</span><span class="o">)</span> <span class="o">{</span>
1699 <span class="nx">m_oSubmenuIndicator</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s2">&quot;em&quot;</span><span class="o">);</span>
1700 <span class="nx">m_oSubmenuIndicator</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span>
1701 <span class="k">this</span><span class="o">.</span><span class="nx">COLLAPSED_SUBMENU_INDICATOR_TEXT</span><span class="o">;</span>
1702 <span class="nx">m_oSubmenuIndicator</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s2">&quot;submenuindicator&quot;</span><span class="o">;</span>
1704 <span class="o">}</span>
1707 <span class="nx">oSubmenuIndicator</span> <span class="o">=</span> <span class="nx">m_oSubmenuIndicator</span><span class="o">.</span><span class="nx">cloneNode</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
1710 <span class="k">if</span><span class="o">(</span><span class="nx">oMenu</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">parentNode</span> <span class="o">==</span> <span class="nx">oEl</span><span class="o">)</span> <span class="o">{</span>
1712 <span class="k">if</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span> <span class="o">==</span> <span class="s2">&quot;opera&quot;</span><span class="o">)</span> <span class="o">{</span>
1714 <span class="nx">oEl</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">oSubmenuIndicator</span><span class="o">);</span>
1716 <span class="nx">oMenu</span><span class="o">.</span><span class="nx">renderEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
1718 <span class="nx">oSubmenuIndicator</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">insertBefore</span><span class="o">(</span>
1719 <span class="nx">oSubmenuIndicator</span><span class="o">,</span>
1720 <span class="nx">oMenu</span><span class="o">.</span><span class="nx">element</span>
1721 <span class="o">);</span>
1723 <span class="o">});</span>
1725 <span class="o">}</span>
1726 <span class="k">else</span> <span class="o">{</span>
1728 <span class="nx">oEl</span><span class="o">.</span><span class="nx">insertBefore</span><span class="o">(</span><span class="nx">oSubmenuIndicator</span><span class="o">,</span> <span class="nx">oMenu</span><span class="o">.</span><span class="nx">element</span><span class="o">);</span>
1730 <span class="o">}</span>
1732 <span class="o">}</span>
1733 <span class="k">else</span> <span class="o">{</span>
1735 <span class="nx">oEl</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">oSubmenuIndicator</span><span class="o">);</span>
1737 <span class="o">}</span>
1739 <span class="k">this</span><span class="o">.</span><span class="nx">submenuIndicator</span> <span class="o">=</span> <span class="nx">oSubmenuIndicator</span><span class="o">;</span>
1741 <span class="o">}</span>
1744 <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">aNodes</span><span class="o">,</span> <span class="s2">&quot;hassubmenu&quot;</span><span class="o">);</span>
1747 <span class="k">if</span><span class="o">(</span><span class="nx">oConfig</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;disabled&quot;</span><span class="o">))</span> <span class="o">{</span>
1749 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">refireEvent</span><span class="o">(</span><span class="s2">&quot;disabled&quot;</span><span class="o">);</span>
1751 <span class="o">}</span>
1753 <span class="k">if</span><span class="o">(</span><span class="nx">oConfig</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;selected&quot;</span><span class="o">))</span> <span class="o">{</span>
1755 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">refireEvent</span><span class="o">(</span><span class="s2">&quot;selected&quot;</span><span class="o">);</span>
1757 <span class="o">}</span>
1759 <span class="o">}</span>
1761 <span class="o">}</span>
1762 <span class="k">else</span> <span class="o">{</span>
1764 <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="nx">aNodes</span><span class="o">,</span> <span class="s2">&quot;hassubmenu&quot;</span><span class="o">);</span>
1766 <span class="k">if</span><span class="o">(</span><span class="nx">oSubmenuIndicator</span><span class="o">)</span> <span class="o">{</span>
1768 <span class="nx">oEl</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="nx">oSubmenuIndicator</span><span class="o">);</span>
1770 <span class="o">}</span>
1772 <span class="k">if</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_oSubmenu</span><span class="o">)</span> <span class="o">{</span>
1774 <span class="k">this</span><span class="o">.</span><span class="nx">_oSubmenu</span><span class="o">.</span><span class="nx">destroy</span><span class="o">();</span>
1776 <span class="o">}</span>
1778 <span class="o">}</span>
1780 <span class="o">},</span>
1783 <span class="c">/**</span>
1784 <span class="c"> * @method configOnClick</span>
1785 <span class="c"> * @description Event handler for when the &quot;onclick&quot; configuration property </span>
1786 <span class="c"> * of the menu item changes. </span>
1787 <span class="c"> * @param {String} p_sType String representing the name of the event that </span>
1788 <span class="c"> * was fired.</span>
1789 <span class="c"> * @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
1790 <span class="c"> * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item</span>
1791 <span class="c"> * that fired the event.</span>
1792 <span class="c"> */</span>
1793 <span class="nx">configOnClick</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">)</span> <span class="o">{</span>
1795 <span class="k">var</span> <span class="nx">oObject</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
1797 <span class="c">/*</span>
1798 <span class="c"> Remove any existing listeners if a &quot;click&quot; event handler has </span>
1799 <span class="c"> already been specified.</span>
1800 <span class="c"> */</span>
1802 <span class="k">if</span><span class="o">(</span>
1803 <span class="k">this</span><span class="o">.</span><span class="nx">_oOnclickAttributeValue</span> <span class="o">&amp;&amp;</span>
1804 <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_oOnclickAttributeValue</span> <span class="o">!=</span> <span class="nx">oObject</span><span class="o">)</span>
1805 <span class="o">)</span> <span class="o">{</span>
1807 <span class="k">this</span><span class="o">.</span><span class="nx">clickEvent</span><span class="o">.</span><span class="nx">unsubscribe</span><span class="o">(</span>
1808 <span class="k">this</span><span class="o">.</span><span class="nx">_oOnclickAttributeValue</span><span class="o">.</span><span class="nx">fn</span><span class="o">,</span>
1809 <span class="k">this</span><span class="o">.</span><span class="nx">_oOnclickAttributeValue</span><span class="o">.</span><span class="nx">obj</span>
1810 <span class="o">);</span>
1812 <span class="k">this</span><span class="o">.</span><span class="nx">_oOnclickAttributeValue</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
1814 <span class="o">}</span>
1817 <span class="k">if</span><span class="o">(</span>
1818 <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">_oOnclickAttributeValue</span> <span class="o">&amp;&amp;</span>
1819 <span class="k">typeof</span> <span class="nx">oObject</span> <span class="o">==</span> <span class="s2">&quot;object&quot;</span> <span class="o">&amp;&amp;</span>
1820 <span class="k">typeof</span> <span class="nx">oObject</span><span class="o">.</span><span class="nx">fn</span> <span class="o">==</span> <span class="s2">&quot;function&quot;</span>
1821 <span class="o">)</span> <span class="o">{</span>
1823 <span class="k">this</span><span class="o">.</span><span class="nx">clickEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span>
1824 <span class="nx">oObject</span><span class="o">.</span><span class="nx">fn</span><span class="o">,</span>
1825 <span class="o">(</span><span class="nx">oObject</span><span class="o">.</span><span class="nx">obj</span> <span class="o">||</span> <span class="k">this</span><span class="o">),</span>
1826 <span class="nx">oObject</span><span class="o">.</span><span class="nx">scope</span>
1827 <span class="o">);</span>
1829 <span class="k">this</span><span class="o">.</span><span class="nx">_oOnclickAttributeValue</span> <span class="o">=</span> <span class="nx">oObject</span><span class="o">;</span>
1831 <span class="o">}</span>
1833 <span class="o">},</span>
1836 <span class="c">/**</span>
1837 <span class="c"> * @method configClassName</span>
1838 <span class="c"> * @description Event handler for when the &quot;classname&quot; configuration </span>
1839 <span class="c"> * property of a menu item changes.</span>
1840 <span class="c"> * @param {String} p_sType String representing the name of the event that </span>
1841 <span class="c"> * was fired.</span>
1842 <span class="c"> * @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
1843 <span class="c"> * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item</span>
1844 <span class="c"> * that fired the event.</span>
1845 <span class="c"> */</span>
1846 <span class="nx">configClassName</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">)</span> <span class="o">{</span>
1848 <span class="k">var</span> <span class="nx">sClassName</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
1850 <span class="k">if</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_sClassName</span><span class="o">)</span> <span class="o">{</span>
1852 <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_sClassName</span><span class="o">);</span>
1854 <span class="o">}</span>
1856 <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">sClassName</span><span class="o">);</span>
1857 <span class="k">this</span><span class="o">.</span><span class="nx">_sClassName</span> <span class="o">=</span> <span class="nx">sClassName</span><span class="o">;</span>
1859 <span class="o">},</span>
1863 <span class="c">// Public methods</span>
1864 <span class="c"></span>
1866 <span class="c">/**</span>
1867 <span class="c"> * @method initDefaultConfig</span>
1868 <span class="c"> * @description Initializes an item&#39;s configurable properties.</span>
1869 <span class="c"> */</span>
1870 <span class="nx">initDefaultConfig</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
1872 <span class="k">var</span> <span class="nx">oConfig</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">,</span>
1873 <span class="nx">CheckBoolean</span> <span class="o">=</span> <span class="nx">oConfig</span><span class="o">.</span><span class="nx">checkBoolean</span><span class="o">;</span>
1876 <span class="c">// Define the configuration attributes</span>
1877 <span class="c"></span>
1878 <span class="c">/**</span>
1879 <span class="c"> * @config text</span>
1880 <span class="c"> * @description String specifying the text label for the menu item. </span>
1881 <span class="c"> * When building a menu from existing HTML the value of this property</span>
1882 <span class="c"> * will be interpreted from the menu&#39;s markup.</span>
1883 <span class="c"> * @default &quot;&quot;</span>
1884 <span class="c"> * @type String</span>
1885 <span class="c"> */</span>
1886 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
1887 <span class="s2">&quot;text&quot;</span><span class="o">,</span>
1888 <span class="o">{</span>
1889 <span class="nx">value</span><span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="o">,</span>
1890 <span class="nx">handler</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">configText</span><span class="o">,</span>
1891 <span class="nx">validator</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">_checkString</span><span class="o">,</span>
1892 <span class="nx">suppressEvent</span><span class="o">:</span> <span class="kc">true</span>
1893 <span class="o">}</span>
1894 <span class="o">);</span>
1897 <span class="c">/**</span>
1898 <span class="c"> * @config helptext</span>
1899 <span class="c"> * @description String specifying additional instructional text to </span>
1900 <span class="c"> * accompany the text for the nenu item.</span>
1901 <span class="c"> * @default null</span>
1902 <span class="c"> * @type String|&lt;a href=&quot;http://www.w3.org/TR/</span>
1903 <span class="c"> * 2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-58190037&quot;&gt;</span>
1904 <span class="c"> * HTMLElement&lt;/a&gt;</span>
1905 <span class="c"> */</span>
1906 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="s2">&quot;helptext&quot;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">handler</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">configHelpText</span> <span class="o">});</span>
1909 <span class="c">/**</span>
1910 <span class="c"> * @config url</span>
1911 <span class="c"> * @description String specifying the URL for the menu item&#39;s anchor&#39;s </span>
1912 <span class="c"> * &quot;href&quot; attribute. When building a menu from existing HTML the value </span>
1913 <span class="c"> * of this property will be interpreted from the menu&#39;s markup.</span>
1914 <span class="c"> * @default &quot;#&quot;</span>
1915 <span class="c"> * @type String</span>
1916 <span class="c"> */</span>
1917 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
1918 <span class="s2">&quot;url&quot;</span><span class="o">,</span>
1919 <span class="o">{</span> <span class="nx">value</span><span class="o">:</span> <span class="s2">&quot;#&quot;</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">configURL</span><span class="o">,</span> <span class="nx">suppressEvent</span><span class="o">:</span> <span class="kc">true</span> <span class="o">}</span>
1920 <span class="o">);</span>
1923 <span class="c">/**</span>
1924 <span class="c"> * @config target</span>
1925 <span class="c"> * @description String specifying the value for the &quot;target&quot; attribute </span>
1926 <span class="c"> * of the menu item&#39;s anchor element. &lt;strong&gt;Specifying a target will </span>
1927 <span class="c"> * require the user to click directly on the menu item&#39;s anchor node in</span>
1928 <span class="c"> * order to cause the browser to navigate to the specified URL.&lt;/strong&gt; </span>
1929 <span class="c"> * When building a menu from existing HTML the value of this property </span>
1930 <span class="c"> * will be interpreted from the menu&#39;s markup.</span>
1931 <span class="c"> * @default null</span>
1932 <span class="c"> * @type String</span>
1933 <span class="c"> */</span>
1934 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
1935 <span class="s2">&quot;target&quot;</span><span class="o">,</span>
1936 <span class="o">{</span> <span class="nx">handler</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">configTarget</span><span class="o">,</span> <span class="nx">suppressEvent</span><span class="o">:</span> <span class="kc">true</span> <span class="o">}</span>
1937 <span class="o">);</span>
1940 <span class="c">/**</span>
1941 <span class="c"> * @config emphasis</span>
1942 <span class="c"> * @description Boolean indicating if the text of the menu item will be </span>
1943 <span class="c"> * rendered with emphasis. When building a menu from existing HTML the </span>
1944 <span class="c"> * value of this property will be interpreted from the menu&#39;s markup.</span>
1945 <span class="c"> * @default false</span>
1946 <span class="c"> * @type Boolean</span>
1947 <span class="c"> */</span>
1948 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
1949 <span class="s2">&quot;emphasis&quot;</span><span class="o">,</span>
1950 <span class="o">{</span>
1951 <span class="nx">value</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
1952 <span class="nx">handler</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">configEmphasis</span><span class="o">,</span>
1953 <span class="nx">validator</span><span class="o">:</span> <span class="nx">CheckBoolean</span><span class="o">,</span>
1954 <span class="nx">suppressEvent</span><span class="o">:</span> <span class="kc">true</span>
1955 <span class="o">}</span>
1956 <span class="o">);</span>
1959 <span class="c">/**</span>
1960 <span class="c"> * @config strongemphasis</span>
1961 <span class="c"> * @description Boolean indicating if the text of the menu item will be </span>
1962 <span class="c"> * rendered with strong emphasis. When building a menu from existing </span>
1963 <span class="c"> * HTML the value of this property will be interpreted from the</span>
1964 <span class="c"> * menu&#39;s markup.</span>
1965 <span class="c"> * @default false</span>
1966 <span class="c"> * @type Boolean</span>
1967 <span class="c"> */</span>
1968 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
1969 <span class="s2">&quot;strongemphasis&quot;</span><span class="o">,</span>
1970 <span class="o">{</span>
1971 <span class="nx">value</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
1972 <span class="nx">handler</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">configStrongEmphasis</span><span class="o">,</span>
1973 <span class="nx">validator</span><span class="o">:</span> <span class="nx">CheckBoolean</span><span class="o">,</span>
1974 <span class="nx">suppressEvent</span><span class="o">:</span> <span class="kc">true</span>
1975 <span class="o">}</span>
1976 <span class="o">);</span>
1979 <span class="c">/**</span>
1980 <span class="c"> * @config checked</span>
1981 <span class="c"> * @description Boolean indicating if the menu item should be rendered </span>
1982 <span class="c"> * with a checkmark.</span>
1983 <span class="c"> * @default false</span>
1984 <span class="c"> * @type Boolean</span>
1985 <span class="c"> */</span>
1986 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
1987 <span class="s2">&quot;checked&quot;</span><span class="o">,</span>
1988 <span class="o">{</span>
1989 <span class="nx">value</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
1990 <span class="nx">handler</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">configChecked</span><span class="o">,</span>
1991 <span class="nx">validator</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">checkBoolean</span><span class="o">,</span>
1992 <span class="nx">suppressEvent</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
1993 <span class="nx">supercedes</span><span class="o">:[</span><span class="s2">&quot;disabled&quot;</span><span class="o">]</span>
1994 <span class="o">}</span>
1995 <span class="o">);</span>
1998 <span class="c">/**</span>
1999 <span class="c"> * @config disabled</span>
2000 <span class="c"> * @description Boolean indicating if the menu item should be disabled. </span>
2001 <span class="c"> * (Disabled menu items are dimmed and will not respond to user input </span>
2002 <span class="c"> * or fire events.)</span>
2003 <span class="c"> * @default false</span>
2004 <span class="c"> * @type Boolean</span>
2005 <span class="c"> */</span>
2006 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
2007 <span class="s2">&quot;disabled&quot;</span><span class="o">,</span>
2008 <span class="o">{</span>
2009 <span class="nx">value</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
2010 <span class="nx">handler</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">configDisabled</span><span class="o">,</span>
2011 <span class="nx">validator</span><span class="o">:</span> <span class="nx">CheckBoolean</span><span class="o">,</span>
2012 <span class="nx">suppressEvent</span><span class="o">:</span> <span class="kc">true</span>
2013 <span class="o">}</span>
2014 <span class="o">);</span>
2017 <span class="c">/**</span>
2018 <span class="c"> * @config selected</span>
2019 <span class="c"> * @description Boolean indicating if the menu item should </span>
2020 <span class="c"> * be highlighted.</span>
2021 <span class="c"> * @default false</span>
2022 <span class="c"> * @type Boolean</span>
2023 <span class="c"> */</span>
2024 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
2025 <span class="s2">&quot;selected&quot;</span><span class="o">,</span>
2026 <span class="o">{</span>
2027 <span class="nx">value</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
2028 <span class="nx">handler</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">configSelected</span><span class="o">,</span>
2029 <span class="nx">validator</span><span class="o">:</span> <span class="nx">CheckBoolean</span><span class="o">,</span>
2030 <span class="nx">suppressEvent</span><span class="o">:</span> <span class="kc">true</span>
2031 <span class="o">}</span>
2032 <span class="o">);</span>
2035 <span class="c">/**</span>
2036 <span class="c"> * @config submenu</span>
2037 <span class="c"> * @description Object specifying the submenu to be appended to the </span>
2038 <span class="c"> * menu item. The value can be one of the following: &lt;ul&gt;&lt;li&gt;Object </span>
2039 <span class="c"> * specifying a Menu instance.&lt;/li&gt;&lt;li&gt;Object literal specifying the</span>
2040 <span class="c"> * menu to be created. Format: &lt;code&gt;{ id: [menu id], itemdata: </span>
2041 <span class="c"> * [&lt;a href=&quot;YAHOO.widget.Menu.html#itemData&quot;&gt;array of values for </span>
2042 <span class="c"> * items&lt;/a&gt;] }&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;String specifying the id attribute </span>
2043 <span class="c"> * of the &lt;code&gt;&amp;#60;div&amp;#62;&lt;/code&gt; element of the menu.&lt;/li&gt;&lt;li&gt;</span>
2044 <span class="c"> * Object specifying the &lt;code&gt;&amp;#60;div&amp;#62;&lt;/code&gt; element of the </span>
2045 <span class="c"> * menu.&lt;/li&gt;&lt;/ul&gt;</span>
2046 <span class="c"> * @default null</span>
2047 <span class="c"> * @type Menu|String|Object|&lt;a href=&quot;http://www.w3.org/TR/2000/</span>
2048 <span class="c"> * WD-DOM-Level-1-20000929/level-one-html.html#ID-58190037&quot;&gt;</span>
2049 <span class="c"> * HTMLElement&lt;/a&gt;</span>
2050 <span class="c"> */</span>
2051 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="s2">&quot;submenu&quot;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">handler</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">configSubmenu</span> <span class="o">});</span>
2054 <span class="c">/**</span>
2055 <span class="c"> * @config onclick</span>
2056 <span class="c"> * @description Object literal representing the code to be executed when </span>
2057 <span class="c"> * the button is clicked. Format:&lt;br&gt; &lt;code&gt; {&lt;br&gt; </span>
2058 <span class="c"> * &lt;strong&gt;fn:&lt;/strong&gt; Function, &amp;#47;&amp;#47; The handler to call when </span>
2059 <span class="c"> * the event fires.&lt;br&gt; &lt;strong&gt;obj:&lt;/strong&gt; Object, &amp;#47;&amp;#47; An </span>
2060 <span class="c"> * object to pass back to the handler.&lt;br&gt; &lt;strong&gt;scope:&lt;/strong&gt; </span>
2061 <span class="c"> * Object &amp;#47;&amp;#47; The object to use for the scope of the handler.</span>
2062 <span class="c"> * &lt;br&gt; } &lt;/code&gt;</span>
2063 <span class="c"> * @type Object</span>
2064 <span class="c"> * @default null</span>
2065 <span class="c"> */</span>
2066 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="s2">&quot;onclick&quot;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">handler</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">configOnClick</span> <span class="o">});</span>
2069 <span class="c">/**</span>
2070 <span class="c"> * @config classname</span>
2071 <span class="c"> * @description CSS class to be applied to the menu item&#39;s root </span>
2072 <span class="c"> * &lt;code&gt;&amp;#60;li&amp;#62;&lt;/code&gt; element. The specified class(es) are </span>
2073 <span class="c"> * appended in addition to the default class as specified by the menu </span>
2074 <span class="c"> * item&#39;s CSS_CLASS_NAME constant.</span>
2075 <span class="c"> * @default null</span>
2076 <span class="c"> * @type String</span>
2077 <span class="c"> */</span>
2078 <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
2079 <span class="s2">&quot;classname&quot;</span><span class="o">,</span>
2080 <span class="o">{</span>
2081 <span class="nx">value</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
2082 <span class="nx">handler</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">configClassName</span><span class="o">,</span>
2083 <span class="nx">validator</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">_checkString</span>
2084 <span class="o">}</span>
2085 <span class="o">);</span>
2087 <span class="o">},</span>
2090 <span class="c">/**</span>
2091 <span class="c"> * @method getNextEnabledSibling</span>
2092 <span class="c"> * @description Finds the menu item&#39;s next enabled sibling.</span>
2093 <span class="c"> * @return YAHOO.widget.MenuItem</span>
2094 <span class="c"> */</span>
2095 <span class="nx">getNextEnabledSibling</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
2097 <span class="k">if</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">parent</span> <span class="k">instanceof</span> <span class="nx">Menu</span><span class="o">)</span> <span class="o">{</span>
2099 <span class="k">var</span> <span class="nx">nGroupIndex</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">groupIndex</span><span class="o">;</span>
2101 <span class="k">function</span> <span class="nx">getNextArrayItem</span><span class="o">(</span><span class="nx">p_aArray</span><span class="o">,</span> <span class="nx">p_nStartIndex</span><span class="o">)</span> <span class="o">{</span>
2103 <span class="k">return</span> <span class="nx">p_aArray</span><span class="o">[</span><span class="nx">p_nStartIndex</span><span class="o">]</span> <span class="o">||</span>
2104 <span class="nx">getNextArrayItem</span><span class="o">(</span><span class="nx">p_aArray</span><span class="o">,</span> <span class="o">(</span><span class="nx">p_nStartIndex</span><span class="o">+</span><span class="m">1</span><span class="o">));</span>
2106 <span class="o">}</span>
2109 <span class="k">var</span> <span class="nx">aItemGroups</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">getItemGroups</span><span class="o">(),</span>
2110 <span class="nx">oNextItem</span><span class="o">;</span>
2113 <span class="k">if</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">index</span> <span class="o">&lt;</span> <span class="o">(</span><span class="nx">aItemGroups</span><span class="o">[</span><span class="nx">nGroupIndex</span><span class="o">].</span><span class="nx">length</span> <span class="o">-</span> <span class="m">1</span><span class="o">))</span> <span class="o">{</span>
2115 <span class="nx">oNextItem</span> <span class="o">=</span> <span class="nx">getNextArrayItem</span><span class="o">(</span>
2116 <span class="nx">aItemGroups</span><span class="o">[</span><span class="nx">nGroupIndex</span><span class="o">],</span>
2117 <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">index</span><span class="o">+</span><span class="m">1</span><span class="o">)</span>
2118 <span class="o">);</span>
2120 <span class="o">}</span>
2121 <span class="k">else</span> <span class="o">{</span>
2123 <span class="k">var</span> <span class="nx">nNextGroupIndex</span><span class="o">;</span>
2125 <span class="k">if</span><span class="o">(</span><span class="nx">nGroupIndex</span> <span class="o">&lt;</span> <span class="o">(</span><span class="nx">aItemGroups</span><span class="o">.</span><span class="nx">length</span> <span class="o">-</span> <span class="m">1</span><span class="o">))</span> <span class="o">{</span>
2127 <span class="nx">nNextGroupIndex</span> <span class="o">=</span> <span class="nx">nGroupIndex</span> <span class="o">+</span> <span class="m">1</span><span class="o">;</span>
2129 <span class="o">}</span>
2130 <span class="k">else</span> <span class="o">{</span>
2132 <span class="nx">nNextGroupIndex</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>
2134 <span class="o">}</span>
2136 <span class="k">var</span> <span class="nx">aNextGroup</span> <span class="o">=</span> <span class="nx">getNextArrayItem</span><span class="o">(</span><span class="nx">aItemGroups</span><span class="o">,</span> <span class="nx">nNextGroupIndex</span><span class="o">);</span>
2138 <span class="c">// Retrieve the first menu item in the next group</span>
2139 <span class="c"></span>
2140 <span class="nx">oNextItem</span> <span class="o">=</span> <span class="nx">getNextArrayItem</span><span class="o">(</span><span class="nx">aNextGroup</span><span class="o">,</span> <span class="m">0</span><span class="o">);</span>
2142 <span class="o">}</span>
2144 <span class="k">return</span> <span class="o">(</span>
2145 <span class="nx">oNextItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;disabled&quot;</span><span class="o">)</span> <span class="o">||</span>
2146 <span class="nx">oNextItem</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">display</span> <span class="o">==</span> <span class="s2">&quot;none&quot;</span>
2147 <span class="o">)</span> <span class="o">?</span>
2148 <span class="nx">oNextItem</span><span class="o">.</span><span class="nx">getNextEnabledSibling</span><span class="o">()</span> <span class="o">:</span> <span class="nx">oNextItem</span><span class="o">;</span>
2150 <span class="o">}</span>
2152 <span class="o">},</span>
2155 <span class="c">/**</span>
2156 <span class="c"> * @method getPreviousEnabledSibling</span>
2157 <span class="c"> * @description Finds the menu item&#39;s previous enabled sibling.</span>
2158 <span class="c"> * @return {YAHOO.widget.MenuItem}</span>
2159 <span class="c"> */</span>
2160 <span class="nx">getPreviousEnabledSibling</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
2162 <span class="k">if</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">parent</span> <span class="k">instanceof</span> <span class="nx">Menu</span><span class="o">)</span> <span class="o">{</span>
2164 <span class="k">var</span> <span class="nx">nGroupIndex</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">groupIndex</span><span class="o">;</span>
2166 <span class="k">function</span> <span class="nx">getPreviousArrayItem</span><span class="o">(</span><span class="nx">p_aArray</span><span class="o">,</span> <span class="nx">p_nStartIndex</span><span class="o">)</span> <span class="o">{</span>
2168 <span class="k">return</span> <span class="nx">p_aArray</span><span class="o">[</span><span class="nx">p_nStartIndex</span><span class="o">]</span> <span class="o">||</span>
2169 <span class="nx">getPreviousArrayItem</span><span class="o">(</span><span class="nx">p_aArray</span><span class="o">,</span> <span class="o">(</span><span class="nx">p_nStartIndex</span><span class="o">-</span><span class="m">1</span><span class="o">));</span>
2171 <span class="o">}</span>
2173 <span class="k">function</span> <span class="nx">getFirstItemIndex</span><span class="o">(</span><span class="nx">p_aArray</span><span class="o">,</span> <span class="nx">p_nStartIndex</span><span class="o">)</span> <span class="o">{</span>
2175 <span class="k">return</span> <span class="nx">p_aArray</span><span class="o">[</span><span class="nx">p_nStartIndex</span><span class="o">]</span> <span class="o">?</span>
2176 <span class="nx">p_nStartIndex</span> <span class="o">:</span>
2177 <span class="nx">getFirstItemIndex</span><span class="o">(</span><span class="nx">p_aArray</span><span class="o">,</span> <span class="o">(</span><span class="nx">p_nStartIndex</span><span class="o">+</span><span class="m">1</span><span class="o">));</span>
2179 <span class="o">}</span>
2181 <span class="k">var</span> <span class="nx">aItemGroups</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">getItemGroups</span><span class="o">(),</span>
2182 <span class="nx">oPreviousItem</span><span class="o">;</span>
2184 <span class="k">if</span><span class="o">(</span>
2185 <span class="k">this</span><span class="o">.</span><span class="nx">index</span> <span class="o">&gt;</span> <span class="nx">getFirstItemIndex</span><span class="o">(</span><span class="nx">aItemGroups</span><span class="o">[</span><span class="nx">nGroupIndex</span><span class="o">],</span> <span class="m">0</span><span class="o">)</span>
2186 <span class="o">)</span> <span class="o">{</span>
2188 <span class="nx">oPreviousItem</span> <span class="o">=</span>
2189 <span class="nx">getPreviousArrayItem</span><span class="o">(</span>
2190 <span class="nx">aItemGroups</span><span class="o">[</span><span class="nx">nGroupIndex</span><span class="o">],</span>
2191 <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">index</span><span class="o">-</span><span class="m">1</span><span class="o">)</span>
2192 <span class="o">);</span>
2194 <span class="o">}</span>
2195 <span class="k">else</span> <span class="o">{</span>
2197 <span class="k">var</span> <span class="nx">nPreviousGroupIndex</span><span class="o">;</span>
2199 <span class="k">if</span><span class="o">(</span><span class="nx">nGroupIndex</span> <span class="o">&gt;</span> <span class="nx">getFirstItemIndex</span><span class="o">(</span><span class="nx">aItemGroups</span><span class="o">,</span> <span class="m">0</span><span class="o">))</span> <span class="o">{</span>
2201 <span class="nx">nPreviousGroupIndex</span> <span class="o">=</span> <span class="nx">nGroupIndex</span> <span class="o">-</span> <span class="m">1</span><span class="o">;</span>
2203 <span class="o">}</span>
2204 <span class="k">else</span> <span class="o">{</span>
2206 <span class="nx">nPreviousGroupIndex</span> <span class="o">=</span> <span class="nx">aItemGroups</span><span class="o">.</span><span class="nx">length</span> <span class="o">-</span> <span class="m">1</span><span class="o">;</span>
2208 <span class="o">}</span>
2210 <span class="k">var</span> <span class="nx">aPreviousGroup</span> <span class="o">=</span>
2211 <span class="nx">getPreviousArrayItem</span><span class="o">(</span><span class="nx">aItemGroups</span><span class="o">,</span> <span class="nx">nPreviousGroupIndex</span><span class="o">);</span>
2213 <span class="nx">oPreviousItem</span> <span class="o">=</span>
2214 <span class="nx">getPreviousArrayItem</span><span class="o">(</span>
2215 <span class="nx">aPreviousGroup</span><span class="o">,</span>
2216 <span class="o">(</span><span class="nx">aPreviousGroup</span><span class="o">.</span><span class="nx">length</span> <span class="o">-</span> <span class="m">1</span><span class="o">)</span>
2217 <span class="o">);</span>
2219 <span class="o">}</span>
2221 <span class="k">return</span> <span class="o">(</span>
2222 <span class="nx">oPreviousItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;disabled&quot;</span><span class="o">)</span> <span class="o">||</span>
2223 <span class="nx">oPreviousItem</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">display</span> <span class="o">==</span> <span class="s2">&quot;none&quot;</span>
2224 <span class="o">)</span> <span class="o">?</span>
2225 <span class="nx">oPreviousItem</span><span class="o">.</span><span class="nx">getPreviousEnabledSibling</span><span class="o">()</span> <span class="o">:</span> <span class="nx">oPreviousItem</span><span class="o">;</span>
2227 <span class="o">}</span>
2229 <span class="o">},</span>
2232 <span class="c">/**</span>
2233 <span class="c"> * @method focus</span>
2234 <span class="c"> * @description Causes the menu item to receive the focus and fires the </span>
2235 <span class="c"> * focus event.</span>
2236 <span class="c"> */</span>
2237 <span class="nx">focus</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
2239 <span class="k">var</span> <span class="nx">oParent</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">,</span>
2240 <span class="nx">oAnchor</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_oAnchor</span><span class="o">,</span>
2241 <span class="nx">oActiveItem</span> <span class="o">=</span> <span class="nx">oParent</span><span class="o">.</span><span class="nx">activeItem</span><span class="o">;</span>
2244 <span class="k">function</span> <span class="nx">setFocus</span><span class="o">()</span> <span class="o">{</span>
2246 <span class="k">try</span> <span class="o">{</span>
2248 <span class="nx">oAnchor</span><span class="o">.</span><span class="nx">focus</span><span class="o">();</span>
2250 <span class="o">}</span>
2251 <span class="k">catch</span><span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{</span>
2253 <span class="o">}</span>
2255 <span class="o">}</span>
2258 <span class="k">if</span><span class="o">(</span>
2259 <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;disabled&quot;</span><span class="o">)</span> <span class="o">&amp;&amp;</span>
2260 <span class="nx">oParent</span> <span class="o">&amp;&amp;</span>
2261 <span class="nx">oParent</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;visible&quot;</span><span class="o">)</span> <span class="o">&amp;&amp;</span>
2262 <span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">display</span> <span class="o">!=</span> <span class="s2">&quot;none&quot;</span>
2263 <span class="o">)</span> <span class="o">{</span>
2265 <span class="k">if</span><span class="o">(</span><span class="nx">oActiveItem</span><span class="o">)</span> <span class="o">{</span>
2267 <span class="nx">oActiveItem</span><span class="o">.</span><span class="nx">blur</span><span class="o">();</span>
2269 <span class="o">}</span>
2272 <span class="c">/*</span>
2273 <span class="c"> Setting focus via a timer fixes a race condition in Firefox, IE </span>
2274 <span class="c"> and Opera where the browser viewport jumps as it trys to </span>
2275 <span class="c"> position and focus the menu.</span>
2276 <span class="c"> */</span>
2278 <span class="nb">window</span><span class="o">.</span><span class="nx">setTimeout</span><span class="o">(</span><span class="nx">setFocus</span><span class="o">,</span> <span class="m">0</span><span class="o">);</span>
2280 <span class="k">this</span><span class="o">.</span><span class="nx">focusEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>
2282 <span class="o">}</span>
2284 <span class="o">},</span>
2287 <span class="c">/**</span>
2288 <span class="c"> * @method blur</span>
2289 <span class="c"> * @description Causes the menu item to lose focus and fires the </span>
2290 <span class="c"> * onblur event.</span>
2291 <span class="c"> */</span>
2292 <span class="nx">blur</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
2294 <span class="k">var</span> <span class="nx">oParent</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">;</span>
2296 <span class="k">if</span><span class="o">(</span>
2297 <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;disabled&quot;</span><span class="o">)</span> <span class="o">&amp;&amp;</span>
2298 <span class="nx">oParent</span> <span class="o">&amp;&amp;</span>
2299 <span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="nx">oParent</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="s2">&quot;visibility&quot;</span><span class="o">)</span> <span class="o">==</span> <span class="s2">&quot;visible&quot;</span>
2300 <span class="o">)</span> <span class="o">{</span>
2302 <span class="k">this</span><span class="o">.</span><span class="nx">_oAnchor</span><span class="o">.</span><span class="nx">blur</span><span class="o">();</span>
2304 <span class="k">this</span><span class="o">.</span><span class="nx">blurEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>
2306 <span class="o">}</span>
2308 <span class="o">},</span>
2311 <span class="c">/**</span>
2312 <span class="c"> * @method destroy</span>
2313 <span class="c"> * @description Removes the menu item&#39;s &lt;code&gt;&amp;#60;li&amp;#62;&lt;/code&gt; element </span>
2314 <span class="c"> * from its parent &lt;code&gt;&amp;#60;ul&amp;#62;&lt;/code&gt; element.</span>
2315 <span class="c"> */</span>
2316 <span class="nx">destroy</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
2318 <span class="k">var</span> <span class="nx">oEl</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">;</span>
2320 <span class="k">if</span><span class="o">(</span><span class="nx">oEl</span><span class="o">)</span> <span class="o">{</span>
2323 <span class="c">// If the item has a submenu, destroy it first</span>
2324 <span class="c"></span>
2325 <span class="k">var</span> <span class="nx">oSubmenu</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;submenu&quot;</span><span class="o">);</span>
2327 <span class="k">if</span><span class="o">(</span><span class="nx">oSubmenu</span><span class="o">)</span> <span class="o">{</span>
2329 <span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">destroy</span><span class="o">();</span>
2331 <span class="o">}</span>
2334 <span class="c">// Remove CustomEvent listeners</span>
2335 <span class="c"></span>
2336 <span class="k">this</span><span class="o">.</span><span class="nx">mouseOverEvent</span><span class="o">.</span><span class="nx">unsubscribeAll</span><span class="o">();</span>
2337 <span class="k">this</span><span class="o">.</span><span class="nx">mouseOutEvent</span><span class="o">.</span><span class="nx">unsubscribeAll</span><span class="o">();</span>
2338 <span class="k">this</span><span class="o">.</span><span class="nx">mouseDownEvent</span><span class="o">.</span><span class="nx">unsubscribeAll</span><span class="o">();</span>
2339 <span class="k">this</span><span class="o">.</span><span class="nx">mouseUpEvent</span><span class="o">.</span><span class="nx">unsubscribeAll</span><span class="o">();</span>
2340 <span class="k">this</span><span class="o">.</span><span class="nx">clickEvent</span><span class="o">.</span><span class="nx">unsubscribeAll</span><span class="o">();</span>
2341 <span class="k">this</span><span class="o">.</span><span class="nx">keyPressEvent</span><span class="o">.</span><span class="nx">unsubscribeAll</span><span class="o">();</span>
2342 <span class="k">this</span><span class="o">.</span><span class="nx">keyDownEvent</span><span class="o">.</span><span class="nx">unsubscribeAll</span><span class="o">();</span>
2343 <span class="k">this</span><span class="o">.</span><span class="nx">keyUpEvent</span><span class="o">.</span><span class="nx">unsubscribeAll</span><span class="o">();</span>
2344 <span class="k">this</span><span class="o">.</span><span class="nx">focusEvent</span><span class="o">.</span><span class="nx">unsubscribeAll</span><span class="o">();</span>
2345 <span class="k">this</span><span class="o">.</span><span class="nx">blurEvent</span><span class="o">.</span><span class="nx">unsubscribeAll</span><span class="o">();</span>
2346 <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">configChangedEvent</span><span class="o">.</span><span class="nx">unsubscribeAll</span><span class="o">();</span>
2349 <span class="c">// Remove the element from the parent node</span>
2350 <span class="c"></span>
2351 <span class="k">var</span> <span class="nx">oParentNode</span> <span class="o">=</span> <span class="nx">oEl</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">;</span>
2353 <span class="k">if</span><span class="o">(</span><span class="nx">oParentNode</span><span class="o">)</span> <span class="o">{</span>
2355 <span class="nx">oParentNode</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="nx">oEl</span><span class="o">);</span>
2357 <span class="k">this</span><span class="o">.</span><span class="nx">destroyEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>
2359 <span class="o">}</span>
2361 <span class="k">this</span><span class="o">.</span><span class="nx">destroyEvent</span><span class="o">.</span><span class="nx">unsubscribeAll</span><span class="o">();</span>
2363 <span class="o">}</span>
2365 <span class="o">},</span>
2368 <span class="c">/**</span>
2369 <span class="c"> * @method toString</span>
2370 <span class="c"> * @description Returns a string representing the menu item.</span>
2371 <span class="c"> * @return {String}</span>
2372 <span class="c"> */</span>
2373 <span class="nx">toString</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
2375 <span class="k">return</span> <span class="o">(</span><span class="s2">&quot;MenuItem: &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;text&quot;</span><span class="o">));</span>
2377 <span class="o">}</span>
2379 <span class="o">};</span>
2381 <span class="o">})();</span>
2382 </pre></div>
2383 </div>
2384 </div>
2385 </div>
2386 <div class="yui-b">
2387 <div class="nav">
2389 <div class="module">
2390 <h4>Modules</h4>
2391 <ul class="content">
2393 <li class=""><a href="module_animation.html">animation</a></li>
2395 <li class=""><a href="module_autocomplete.html">autocomplete</a></li>
2397 <li class=""><a href="module_button.html">button</a></li>
2399 <li class=""><a href="module_calendar.html">calendar</a></li>
2401 <li class=""><a href="module_connection.html">connection</a></li>
2403 <li class=""><a href="module_container.html">container</a></li>
2405 <li class=""><a href="module_datasource.html">datasource</a></li>
2407 <li class=""><a href="module_datatable.html">datatable</a></li>
2409 <li class=""><a href="module_dom.html">dom</a></li>
2411 <li class=""><a href="module_dragdrop.html">dragdrop</a></li>
2413 <li class=""><a href="module_element.html">element</a></li>
2415 <li class=""><a href="module_event.html">event</a></li>
2417 <li class=""><a href="module_history.html">history</a></li>
2419 <li class=""><a href="module_logger.html">logger</a></li>
2421 <li class="selected"><a href="module_menu.html">menu</a></li>
2423 <li class=""><a href="module_slider.html">slider</a></li>
2425 <li class=""><a href="module_tabview.html">tabview</a></li>
2427 <li class=""><a href="module_treeview.html">treeview</a></li>
2429 <li class=""><a href="module_yahoo.html">yahoo</a></li>
2430 </ul>
2431 </div>
2433 <div class="module">
2434 <h4>Classes</h4>
2435 <ul class="content">
2436 <li class=""><a href="YAHOO.widget.ContextMenu.html">YAHOO.widget.ContextMenu</a></li>
2437 <li class=""><a href="YAHOO.widget.ContextMenuItem.html">YAHOO.widget.ContextMenuItem</a></li>
2438 <li class=""><a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a></li>
2439 <li class=""><a href="YAHOO.widget.Menubar.html">YAHOO.widget.Menubar</a></li>
2440 <li class=""><a href="YAHOO.widget.MenuBarItem.html">YAHOO.widget.MenuBarItem</a></li>
2441 <li class=""><a href="YAHOO.widget.MenuItem.html">YAHOO.widget.MenuItem</a></li>
2442 <li class=""><a href="YAHOO.widget.MenuManager.html">YAHOO.widget.MenuManager</a></li>
2443 </ul>
2444 </div>
2446 <div class="module">
2447 <h4>Files</h4>
2448 <ul class="content">
2449 <li class=""><a href="contextmenu.js.html">contextmenu.js</a></li>
2450 <li class=""><a href="contextmenuitem.js.html">contextmenuitem.js</a></li>
2451 <li class=""><a href="menu.js.html">menu.js</a></li>
2452 <li class=""><a href="menubar.js.html">menubar.js</a></li>
2453 <li class=""><a href="menubaritem.js.html">menubaritem.js</a></li>
2454 <li class="selected"><a href="menuitem.js.html">menuitem.js</a></li>
2455 <li class=""><a href="menumanager.js.html">menumanager.js</a></li>
2456 </ul>
2457 </div>
2463 </div>
2464 </div>
2465 </div>
2466 <div id="ft">
2467 <hr />
2468 Copyright &copy; 2007 Yahoo! Inc. All rights reserved.
2469 </div>
2470 </div>
2471 </body>
2472 </html>