Class Index | File Index

## Classes

- _global_
- Array
- fabric.Circle
- fabric.Color
- fabric.Element
- fabric.Element#cache
- fabric.Ellipse
- fabric.Group
- fabric.Image
- fabric.Intersection
- fabric.Line
- fabric.Object
- fabric.Path
- fabric.PathGroup
- fabric.Point
- fabric.Polygon
- fabric.Polyline
- fabric.Rect
- fabric.Text
- fabric.Triangle
- fabric.util
- fabric.util.array
- fabric.util.object
- fabric.util.string
- Function
- String

# Namespace fabric.util

Defined in: util.js.

Namespace Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| fabric.util

Method Summary
Method Attributes | Method Name and Description
--- | ---
<static> | fabric.util.addListener(element, eventName, handler) Adds an event listener to an element
<static> | fabric.util.createClass() Helper for creation of "classes"
<static> | fabric.util.degreesToRadians(degrees) Transforms degrees to radians.
<static> | fabric.util.falseFunction() Function which always returns `false`.
<static> | fabric.util.fireEvent(eventName, memo) Fires event with an optional memo object
<static> | fabric.util.getPointer(event) Cross-browser wrapper for getting event's coordinates
<static> | fabric.util.getRandomInt(min, max) Returns random number between 2 specified ones.
<static> | fabric.util.observeEvent(eventName, handler)
<static> | fabric.util.removeFromArray(array, value) Removes value from an array.
<static> | fabric.util.removeListener(element, eventName, handler) Removes an event listener from an element
<static> | fabric.util.toFixed(number, fractionDigits) A wrapper around Number#toFixed, which contrary to native method returns number, not string.

Namespace Detail
fabric.util
Method Detail
<static> fabric.util.addListener(element, eventName, handler)
Adds an event listener to an element
Defined in: dom_event.js.

Parameters:
{HTMLElement} element
{String} eventName
{Function} handler

<static> fabric.util.createClass()
Helper for creation of "classes"
Defined in: lang_class.js.

<static> {Number} fabric.util.degreesToRadians(degrees)
Transforms degrees to radians.
Defined in: misc.js.

Parameters:
{Number} degrees
  value in degrees

Returns:
  {Number} value in radians

<static> {Boolean} fabric.util.falseFunction()
Function which always returns `false`.
Defined in: misc.js.

Returns:
  {Boolean}

<static> fabric.util.fireEvent(eventName, memo)
Fires event with an optional memo object
Defined in: dom_event.js.

Parameters:
{String} eventName
{Object} memo Optional

<static> fabric.util.getPointer(event)
Cross-browser wrapper for getting event's coordinates
Defined in: dom_event.js.

Parameters:
{Event} event

<static> {Number} fabric.util.getRandomInt(min, max)
Returns random number between 2 specified ones.
Defined in: misc.js.

Parameters:
{Number} min
  lower limit
{Number} max
  upper limit

Returns:
  {Number} random value (between min and max)

<static> fabric.util.observeEvent(eventName, handler)
Defined in: dom_event.js.

Parameters:
{String} eventName
{Function} handler

<static> {Array} fabric.util.removeFromArray(array, value)
Removes value from an array. Presence of value (and its position in an array) is determined via `Array.prototype.indexOf`
Defined in: misc.js.

Parameters:
{Array} array
{Any} value

Returns:
  {Array} original array

<static> fabric.util.removeListener(element, eventName, handler)
Removes an event listener from an element
Defined in: dom_event.js.

Parameters:
{HTMLElement} element
{String} eventName
{Function} handler

<static> {Number} fabric.util.toFixed(number, fractionDigits)
A wrapper around Number#toFixed, which contrary to native method returns number, not string.
Defined in: misc.js.

Parameters:
{Number | String} number
  number to operate on
{Number} fractionDigits
  number of fraction digits to "leave"

Returns:
  {Number}

Documentation generated by JsDoc Toolkit 2.4.0 on Thu Oct 14 2010 21:41:43 GMT-0400 (EDT)