DropdownEventHandler
Import :
const DropdownEventHandler = brackets.getModule("utils/DropdownEventHandler")
DropdownEventHandler
Kind: global class
new DropdownEventHandler($list, selectionCallback, closeCallback, keyDownCallback)
Object to handle events for a dropdown list.
DropdownEventHandler handles these events:
Mouse:
- click - execute selection callback and dismiss list
- mouseover - highlight item
- mouseleave - remove mouse highlighting
Keyboard:
- Enter - execute selection callback and dismiss list
- Esc - dismiss list
- Up/Down - change selection
- PageUp/Down - change selection
Items whose "a" has the .disabled class do not respond to selection.
Param | Type | Description |
---|---|---|
$list | jQueryObject | associated list object |
selectionCallback | function | function called when list item is selected. |
closeCallback | function | function called when list item is selected. |
keyDownCallback | function | function called when list item is selected. |
dropdownEventHandler.open()
Public open method
Kind: instance method of DropdownEventHandler
dropdownEventHandler.close()
Public close method
Kind: instance method of DropdownEventHandler
dropdownEventHandler.reRegisterMouseHandlers($list)
Re-register mouse event handlers
Kind: instance method of DropdownEventHandler
Param | Type | Description |
---|---|---|
$list | jQueryObject | newly updated list object |