Helper class for checking if element will fit at the desired side of cursor.
Methods
-
fitsAbove(element){boolean}
-
Checks if element can be placed above the cursor.
Parameters:
Name Type Description element
HTMLElement Element to check if it's size will fit above the cursor.
Returns: {boolean}
-
fitsBelow(element, viewportHeight){boolean}
-
Checks if element can be placed below the cursor.
Parameters:
Name Type Description element
HTMLElement Element to check if it's size will fit below the cursor.
viewportHeight
number optional The viewport height.
Returns: {boolean}
-
fitsOnLeft(element){boolean}
-
Checks if element can be placed on the left on the cursor.
Parameters:
Name Type Description element
HTMLElement Element to check if it's size will fit on the left of the cursor.
Returns: {boolean}
-
fitsOnRight(element, viewportWidth){boolean}
-
Checks if element can be placed on the right of the cursor.
Parameters:
Name Type Description element
HTMLElement Element to check if it's size will fit on the right of the cursor.
viewportWidth
number optional The viewport width.
Returns: {boolean}
-
getSourceType(object){string}
-
Get source type name.
Parameters:
Name Type Description object
* Event or Object with coordinates.
Returns: {string} Returns one of this values:
'literal'
,'event'
.