-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu-debug.js
More file actions
8317 lines (5573 loc) · 204 KB
/
menu-debug.js
File metadata and controls
8317 lines (5573 loc) · 204 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.2.0
*/
/**
* @module menu
* @description <p>The Menu family of components features a collection of
* controls that make it easy to add menus to your website or web application.
* With the Menu Controls you can create website fly-out menus, customized
* context menus, or application-style menu bars with just a small amount of
* scripting.</p><p>The Menu family of controls features:</p>
* <ul>
* <li>Screen-reader accessibility.</li>
* <li>Keyboard and mouse navigation.</li>
* <li>A rich event model that provides access to all of a menu's
* interesting moments.</li>
* <li>Support for
* <a href="http://en.wikipedia.org/wiki/Progressive_Enhancement">Progressive
* Enhancement</a>; Menus can be created from simple,
* semantic markup on the page or purely through JavaScript.</li>
* </ul>
* @title Menu
* @namespace YAHOO.widget
* @requires Event, Dom, Container
*/
(function() {
var Dom = YAHOO.util.Dom,
Event = YAHOO.util.Event;
/**
* Singleton that manages a collection of all menus and menu items. Listens for
* DOM events at the document level and dispatches the events to the
* corresponding menu or menu item.
*
* @namespace YAHOO.widget
* @class MenuManager
* @static
*/
YAHOO.widget.MenuManager = function() {
// Private member variables
// Flag indicating if the DOM event handlers have been attached
var m_bInitializedEventHandlers = false,
// Collection of menus
m_oMenus = {},
// Collection of menu items
m_oItems = {},
// Collection of visible menus
m_oVisibleMenus = {},
me = this;
var m_oLogger = new YAHOO.widget.LogWriter(this.toString());
// Private methods
/**
* @method addItem
* @description Adds an item to the collection of known menu items.
* @private
* @param {YAHOO.widget.MenuItem} p_oItem Object specifying the MenuItem
* instance to be added.
*/
function addItem(p_oItem) {
var sId = p_oItem.id;
if(p_oItem && m_oItems[sId] != p_oItem) {
m_oItems[sId] = p_oItem;
p_oItem.destroyEvent.subscribe(onItemDestroy, p_oItem);
m_oLogger.log("Item: " +
p_oItem.toString() + " successfully registered.");
}
}
/**
* @method removeItem
* @description Removes an item from the collection of known menu items.
* @private
* @param {YAHOO.widget.MenuItem} p_oItem Object specifying the MenuItem
* instance to be removed.
*/
function removeItem(p_oItem) {
var sId = p_oItem.id;
if(sId && m_oItems[sId]) {
delete m_oItems[sId];
m_oLogger.log("Item: " +
p_oItem.toString() + " successfully unregistered.");
}
}
/**
* @method getMenuRootElement
* @description Finds the root DIV node of a menu or the root LI node of a
* menu item.
* @private
* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
* one-html.html#ID-58190037">HTMLElement</a>} p_oElement Object specifying
* an HTML element.
*/
function getMenuRootElement(p_oElement) {
var oParentNode;
if(p_oElement && p_oElement.tagName) {
switch(p_oElement.tagName.toUpperCase()) {
case "DIV":
oParentNode = p_oElement.parentNode;
// Check if the DIV is the inner "body" node of a menu
if(
(
Dom.hasClass(p_oElement, "hd") ||
Dom.hasClass(p_oElement, "bd") ||
Dom.hasClass(p_oElement, "ft")
)
&&
oParentNode &&
oParentNode.tagName &&
oParentNode.tagName.toUpperCase() == "DIV"
) {
return oParentNode;
}
else {
return p_oElement;
}
break;
case "LI":
return p_oElement;
default:
oParentNode = p_oElement.parentNode;
if(oParentNode) {
return getMenuRootElement(oParentNode);
}
break;
}
}
}
// Private event handlers
/**
* @method onDOMEvent
* @description Generic, global event handler for all of a menu's DOM-based
* events. This listens for events against the document object. If the
* target of a given event is a member of a menu or menu item's DOM, the
* instance's corresponding Custom Event is fired.
* @private
* @param {Event} p_oEvent Object representing the DOM event object passed
* back by the event utility (YAHOO.util.Event).
*/
function onDOMEvent(p_oEvent) {
// Get the target node of the DOM event
var oTarget = Event.getTarget(p_oEvent),
// See if the target of the event was a menu, or a menu item
oElement = getMenuRootElement(oTarget),
oMenuItem,
oMenu;
if(oElement) {
var sTagName = oElement.tagName.toUpperCase();
if(sTagName == "LI") {
var sId = oElement.id;
if(sId && m_oItems[sId]) {
oMenuItem = m_oItems[sId];
oMenu = oMenuItem.parent;
}
}
else if(sTagName == "DIV") {
if(oElement.id) {
oMenu = m_oMenus[oElement.id];
}
}
}
if(oMenu) {
// Map of DOM event names to CustomEvent names
var oEventTypes = {
"click": "clickEvent",
"mousedown": "mouseDownEvent",
"mouseup": "mouseUpEvent",
"mouseover": "mouseOverEvent",
"mouseout": "mouseOutEvent",
"keydown": "keyDownEvent",
"keyup": "keyUpEvent",
"keypress": "keyPressEvent"
},
sCustomEventType = oEventTypes[p_oEvent.type];
// Fire the Custom Even that corresponds the current DOM event
if(oMenuItem && !oMenuItem.cfg.getProperty("disabled")) {
oMenuItem[sCustomEventType].fire(p_oEvent);
}
oMenu[sCustomEventType].fire(p_oEvent, oMenuItem);
}
else if(p_oEvent.type == "mousedown") {
/*
If the target of the event wasn't a menu, hide all
dynamically positioned menus
*/
var oActiveItem;
for(var i in m_oMenus) {
if(m_oMenus.hasOwnProperty(i)) {
oMenu = m_oMenus[i];
if(
oMenu.cfg.getProperty("clicktohide") &&
oMenu.cfg.getProperty("position") == "dynamic"
) {
oMenu.hide();
}
else {
oMenu.clearActiveItem(true);
}
}
}
}
}
/**
* @method onMenuDestroy
* @description "destroy" event handler for a menu.
* @private
* @param {String} p_sType String representing the name of the event that
* was fired.
* @param {Array} p_aArgs Array of arguments sent when the event was fired.
* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that
* fired the event.
*/
function onMenuDestroy(p_sType, p_aArgs, p_oMenu) {
if(p_oMenu && m_oMenus[p_oMenu.id]) {
delete m_oMenus[p_oMenu.id];
m_oLogger.log("Menu: " +
p_oMenu.toString() + " successfully unregistered.");
}
}
/**
* @method onItemDestroy
* @description "destroy" event handler for a MenuItem instance.
* @private
* @param {String} p_sType String representing the name of the event that
* was fired.
* @param {Array} p_aArgs Array of arguments sent when the event was fired.
* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
* that fired the event.
*/
function onItemDestroy(p_sType, p_aArgs, p_oItem) {
var sId = p_oItem.id;
if(sId && m_oItems[sId]) {
delete m_oItems[sId];
}
}
/**
* @method onMenuVisibleConfigChange
* @description Event handler for when the "visible" configuration property
* of a Menu instance changes.
* @private
* @param {String} p_sType String representing the name of the event that
* was fired.
* @param {Array} p_aArgs Array of arguments sent when the event was fired.
* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that
* fired the event.
*/
function onMenuVisibleConfigChange(p_sType, p_aArgs, p_oMenu) {
var bVisible = p_aArgs[0];
if(bVisible) {
m_oVisibleMenus[p_oMenu.id] = p_oMenu;
m_oLogger.log("Menu: " +
p_oMenu.toString() +
" registered with the collection of visible menus.");
}
else if(m_oVisibleMenus[p_oMenu.id]) {
delete m_oVisibleMenus[p_oMenu.id];
m_oLogger.log("Menu: " +
p_oMenu.toString() +
" unregistered from the collection of visible menus.");
}
}
/**
* @method onItemAdded
* @description "itemadded" event handler for a Menu instance.
* @private
* @param {String} p_sType String representing the name of the event that
* was fired.
* @param {Array} p_aArgs Array of arguments sent when the event was fired.
*/
function onItemAdded(p_sType, p_aArgs) {
addItem(p_aArgs[0]);
}
/**
* @method onItemRemoved
* @description "itemremoved" event handler for a Menu instance.
* @private
* @param {String} p_sType String representing the name of the event that
* was fired.
* @param {Array} p_aArgs Array of arguments sent when the event was fired.
*/
function onItemRemoved(p_sType, p_aArgs) {
removeItem(p_aArgs[0]);
}
return {
// Privileged methods
/**
* @method addMenu
* @description Adds a menu to the collection of known menus.
* @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu
* instance to be added.
*/
addMenu: function(p_oMenu) {
if(p_oMenu && p_oMenu.id && !m_oMenus[p_oMenu.id]) {
m_oMenus[p_oMenu.id] = p_oMenu;
if(!m_bInitializedEventHandlers) {
var oDoc = document;
Event.addListener(oDoc, "mouseover", onDOMEvent, me, true);
Event.addListener(oDoc, "mouseout", onDOMEvent, me, true);
Event.addListener(oDoc, "mousedown", onDOMEvent, me, true);
Event.addListener(oDoc, "mouseup", onDOMEvent, me, true);
Event.addListener(oDoc, "click", onDOMEvent, me, true);
Event.addListener(oDoc, "keydown", onDOMEvent, me, true);
Event.addListener(oDoc, "keyup", onDOMEvent, me, true);
Event.addListener(oDoc, "keypress", onDOMEvent, me, true);
m_bInitializedEventHandlers = true;
m_oLogger.log("DOM event handlers initialized.");
}
p_oMenu.destroyEvent.subscribe(onMenuDestroy, p_oMenu, me);
p_oMenu.cfg.subscribeToConfigEvent(
"visible",
onMenuVisibleConfigChange,
p_oMenu
);
p_oMenu.itemAddedEvent.subscribe(onItemAdded);
p_oMenu.itemRemovedEvent.subscribe(onItemRemoved);
m_oLogger.log("Menu: " +
p_oMenu.toString() + " successfully registered.");
}
},
/**
* @method removeMenu
* @description Removes a menu from the collection of known menus.
* @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu
* instance to be removed.
*/
removeMenu: function(p_oMenu) {
if(p_oMenu && m_oMenus[p_oMenu.id]) {
delete m_oMenus[p_oMenu.id];
m_oLogger.log("Menu: " +
p_oMenu.toString() + " successfully unregistered.");
}
},
/**
* @method hideVisible
* @description Hides all visible, dynamically positioned menus.
*/
hideVisible: function() {
var oMenu;
for(var i in m_oVisibleMenus) {
if(m_oVisibleMenus.hasOwnProperty(i)) {
oMenu = m_oVisibleMenus[i];
if(oMenu.cfg.getProperty("position") == "dynamic") {
oMenu.hide();
}
}
}
},
/**
* @method getMenus
* @description Returns an array of all menus registered with the
* menu manger.
* @return {Array}
*/
getMenus: function() {
return m_oMenus;
},
/**
* @method getMenu
* @description Returns a menu with the specified id.
* @param {String} p_sId String specifying the id of the menu to
* be retrieved.
* @return {YAHOO.widget.Menu}
*/
getMenu: function(p_sId) {
if(m_oMenus[p_sId]) {
return m_oMenus[p_sId];
}
},
/**
* @method toString
* @description Returns a string representing the menu manager.
* @return {String}
*/
toString: function() {
return ("MenuManager");
}
};
}();
})();
/**
* The Menu class creates a container that holds a vertical list representing
* a set of options or commands. Menu is the base class for all
* menu containers.
* @param {String} p_oElement String specifying the id attribute of the
* <code><div></code> element of the menu.
* @param {String} p_oElement String specifying the id attribute of the
* <code><select></code> element to be used as the data source
* for the menu.
* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
* level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object
* specifying the <code><div></code> element of the menu.
* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
* level-one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement
* Object specifying the <code><select></code> element to be used as
* the data source for the menu.
* @param {Object} p_oConfig Optional. Object literal specifying the
* configuration for the menu. See configuration class documentation for
* more details.
* @namespace YAHOO.widget
* @class Menu
* @constructor
* @extends YAHOO.widget.Overlay
*/
(function() {
var Dom = YAHOO.util.Dom,
Event = YAHOO.util.Event,
Lang = YAHOO.lang;
YAHOO.widget.Menu = function(p_oElement, p_oConfig) {
if(p_oConfig) {
this.parent = p_oConfig.parent;
this.lazyLoad = p_oConfig.lazyLoad || p_oConfig.lazyload;
this.itemData = p_oConfig.itemData || p_oConfig.itemdata;
}
YAHOO.widget.Menu.superclass.constructor.call(
this,
p_oElement,
p_oConfig
);
};
YAHOO.lang.extend(YAHOO.widget.Menu, YAHOO.widget.Overlay, {
// Constants
/**
* @property CSS_CLASS_NAME
* @description String representing the CSS class(es) to be applied to the
* menu's <code><div></code> element.
* @default "yuimenu"
* @final
* @type String
*/
CSS_CLASS_NAME: "yuimenu",
/**
* @property ITEM_TYPE
* @description Object representing the type of menu item to instantiate and
* add when parsing the child nodes (either <code><li></code> element,
* <code><optgroup></code> element or <code><option></code>)
* of the menu's source HTML element.
* @default YAHOO.widget.MenuItem
* @final
* @type YAHOO.widget.MenuItem
*/
ITEM_TYPE: null,
/**
* @property GROUP_TITLE_TAG_NAME
* @description String representing the tagname of the HTML element used to
* title the menu's item groups.
* @default H6
* @final
* @type String
*/
GROUP_TITLE_TAG_NAME: "h6",
// Private properties
/**
* @property _nHideDelayId
* @description Number representing the time-out setting used to cancel the
* hiding of a menu.
* @default null
* @private
* @type Number
*/
_nHideDelayId: null,
/**
* @property _nShowDelayId
* @description Number representing the time-out setting used to cancel the
* showing of a menu.
* @default null
* @private
* @type Number
*/
_nShowDelayId: null,
/**
* @property _nSubmenuHideDelayId
* @description Number representing the time-out setting used to cancel the
* hiding of a submenu.
* @default null
* @private
* @type Number
*/
_nSubmenuHideDelayId: null,
/**
* @property _nBodyScrollId
* @description Number representing the time-out setting used to cancel the
* scrolling of the menu's body element.
* @default null
* @private
* @type Number
*/
_nBodyScrollId: null,
/**
* @property _bHideDelayEventHandlersAssigned
* @description Boolean indicating if the "mouseover" and "mouseout" event
* handlers used for hiding the menu via a call to "window.setTimeout" have
* already been assigned.
* @default false
* @private
* @type Boolean
*/
_bHideDelayEventHandlersAssigned: false,
/**
* @property _bHandledMouseOverEvent
* @description Boolean indicating the current state of the menu's
* "mouseover" event.
* @default false
* @private
* @type Boolean
*/
_bHandledMouseOverEvent: false,
/**
* @property _bHandledMouseOutEvent
* @description Boolean indicating the current state of the menu's
* "mouseout" event.
* @default false
* @private
* @type Boolean
*/
_bHandledMouseOutEvent: false,
/**
* @property _aGroupTitleElements
* @description Array of HTML element used to title groups of menu items.
* @default []
* @private
* @type Array
*/
_aGroupTitleElements: null,
/**
* @property _aItemGroups
* @description Multi-dimensional Array representing the menu items as they
* are grouped in the menu.
* @default []
* @private
* @type Array
*/
_aItemGroups: null,
/**
* @property _aListElements
* @description Array of <code><ul></code> elements, each of which is
* the parent node for each item's <code><li></code> element.
* @default []
* @private
* @type Array
*/
_aListElements: null,
/**
* @property _nCurrentMouseX
* @description The current x coordinate of the mouse inside the area of
* the menu.
* @default 0
* @private
* @type Number
*/
_nCurrentMouseX: 0,
/**
* @property _nMaxHeight
* @description The original value of the "maxheight" configuration property
* as set by the user.
* @default -1
* @private
* @type Number
*/
_nMaxHeight: -1,
/**
* @property _bStopMouseEventHandlers
* @description Stops "mouseover," "mouseout," and "mousemove" event handlers
* from executing.
* @default false
* @private
* @type Boolean
*/
_bStopMouseEventHandlers: false,
/**
* @property _sClassName
* @description The current value of the "classname" configuration attribute.
* @default null
* @private
* @type String
*/
_sClassName: null,
// Public properties
/**
* @property lazyLoad
* @description Boolean indicating if the menu's "lazy load" feature is
* enabled. If set to "true," initialization and rendering of the menu's
* items will be deferred until the first time it is made visible. This
* property should be set via the constructor using the configuration
* object literal.
* @default false
* @type Boolean
*/
lazyLoad: false,
/**
* @property itemData
* @description Array of items to be added to the menu. The array can contain
* strings representing the text for each item to be created, object literals
* representing the menu item configuration properties, or MenuItem instances.
* This property should be set via the constructor using the configuration
* object literal.
* @default null
* @type Array
*/
itemData: null,
/**
* @property activeItem
* @description Object reference to the item in the menu that has focus.
* @default null
* @type YAHOO.widget.MenuItem
*/
activeItem: null,
/**
* @property parent
* @description Object reference to the menu's parent menu or menu item.
* This property can be set via the constructor using the configuration
* object literal.
* @default null
* @type YAHOO.widget.MenuItem
*/
parent: null,
/**
* @property srcElement
* @description Object reference to the HTML element (either
* <code><select></code> or <code><div></code>) used to
* create the menu.
* @default null
* @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
* level-one-html.html#ID-94282980">HTMLSelectElement</a>|<a
* href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.
* html#ID-22445964">HTMLDivElement</a>
*/
srcElement: null,
// Events
/**
* @event mouseOverEvent
* @description Fires when the mouse has entered the menu. Passes back
* the DOM Event object as an argument.
*/
mouseOverEvent: null,
/**
* @event mouseOutEvent
* @description Fires when the mouse has left the menu. Passes back the DOM
* Event object as an argument.
* @type YAHOO.util.CustomEvent
*/
mouseOutEvent: null,
/**
* @event mouseDownEvent
* @description Fires when the user mouses down on the menu. Passes back the
* DOM Event object as an argument.
* @type YAHOO.util.CustomEvent
*/
mouseDownEvent: null,
/**
* @event mouseUpEvent
* @description Fires when the user releases a mouse button while the mouse is
* over the menu. Passes back the DOM Event object as an argument.
* @type YAHOO.util.CustomEvent
*/
mouseUpEvent: null,
/**
* @event clickEvent
* @description Fires when the user clicks the on the menu. Passes back the
* DOM Event object as an argument.
* @type YAHOO.util.CustomEvent
*/
clickEvent: null,
/**
* @event keyPressEvent
* @description Fires when the user presses an alphanumeric key when one of the
* menu's items has focus. Passes back the DOM Event object as an argument.
* @type YAHOO.util.CustomEvent
*/
keyPressEvent: null,
/**
* @event keyDownEvent
* @description Fires when the user presses a key when one of the menu's items
* has focus. Passes back the DOM Event object as an argument.
* @type YAHOO.util.CustomEvent
*/
keyDownEvent: null,
/**
* @event keyUpEvent
* @description Fires when the user releases a key when one of the menu's items
* has focus. Passes back the DOM Event object as an argument.
* @type YAHOO.util.CustomEvent
*/
keyUpEvent: null,
/**
* @event itemAddedEvent
* @description Fires when an item is added to the menu.
* @type YAHOO.util.CustomEvent
*/
itemAddedEvent: null,
/**
* @event itemRemovedEvent
* @description Fires when an item is removed to the menu.
* @type YAHOO.util.CustomEvent
*/
itemRemovedEvent: null,
/**
* @method init
* @description The Menu class's initialization method. This method is
* automatically called by the constructor, and sets up all DOM references
* for pre-existing markup, and creates required markup if it is not
* already present.
* @param {String} p_oElement String specifying the id attribute of the
* <code><div></code> element of the menu.
* @param {String} p_oElement String specifying the id attribute of the
* <code><select></code> element to be used as the data source
* for the menu.