new Event(event)
Wrapper for events
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | The DOM event |
Members
-
altKey
-
If the alt key was pressed
-
backspaceKey
-
If the backspace was pressed
-
downKey
-
If the down key was pressed
-
element
-
The target element
-
escapeKey
-
If the escape key was pressed
-
event
-
The event
-
keyCode
-
The key code
-
leftKey
-
If the left key was pressed
-
metaKey
-
If the command key was pressed
-
returnKey
-
If the return key was pressed
-
rightKey
-
If the right key was pressed
-
shiftKey
-
If the shift key was pressed
-
spaceKey
-
If the space key was pressed
-
upKey
-
If the up key was pressed
Methods
-
findByClass(cls)
-
Finds the nearest ancester with a certain class name
Parameters:
Name Type Description cls
The css class name
Returns:
The found element or null
- Type
- Element
-
findByTag(tag)
-
Finds the nearest ancester with a certain tag name
Parameters:
Name Type Description tag
The tag name
Returns:
The found element or null
- Type
- Element
-
getElement()
-
Get the node the event originates from
Returns:
The originating element
- Type
- ELement
-
getLeft()
-
Get the left coordinate
Returns:
The left coordinate
- Type
- Number
-
getTop()
-
Get the top coordinate
Returns:
The top coordinate
- Type
- Number
-
stop()
-
Stops the event from propagating