Skip to main content

DropdownEventHandler

Import :

const DropdownEventHandler = brackets.getModule("utils/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.

ParamTypeDescription
$listjQueryObjectassociated list object
selectionCallbackfunctionfunction called when list item is selected.
closeCallbackfunctionfunction called when list item is selected.
keyDownCallbackfunctionfunction called when list item is selected.

Public open method

Kind: instance method of DropdownEventHandler

Public close method

Kind: instance method of DropdownEventHandler

Re-register mouse event handlers

Kind: instance method of DropdownEventHandler

ParamTypeDescription
$listjQueryObjectnewly updated list object