-
Notifications
You must be signed in to change notification settings - Fork 5
Retina basic functions
Retina.keys(object, noFunctions)
Returns an array of keys of object. If noFunctions is true, functions will be omitted in the array. This function only iterates over the topmost object level.
Retina.values(object)
Returns an array of values of object. This function only iterates over the topmost object level.
Retina.traverse(object, function)
Calls function on each scalar value of an object. This will traverse the entire object hierarchy.
Retina.propSort(property, direction)
This can be used as a sorting function in array.sort(). The array must contain objects which will be sorted by the property property. Default sort order is alphabetically ascending. Setting direction to true will sort descending.
Retina.mouseCoords(event)
This can be called with an event to receive an object with the properties x and y which are the mouse coordinates relative to the top left corner of the HTML document.