Skip to content

EventController.js

deployment script via Travis CI edited this page Mar 4, 2020 · 5 revisions

Functions

flushRectCaches()void

flushes the cache for each eventControlElement

add(elements)void

Adds an array of elements to the system. Calling this method from outside this class only makes sense in few cases, because changes to the element are not observed if isn't child of the baseElement.

getEventControlElement(domElement)EventControlElement | void

finds the EventControlElement that belongs to a certain domElement

addEventControlElement(domElement)void

Similar to add(), but for a single DOM element and without query filters. Again, calling this method from outside this class only makes sense in few cases, because changes to the element are not observed if itn't child of the baseElement.

listenToChangeCss(eventType, [modificationFunction], [additionalFilter], [postFunction])void

Adds an eventListener for each DOM element that matches the criteria.

doEvent(event)void

runs modification functions and postfunctions for all EventControlElements, if they have previously been passed via listenToChangeCss

flushRectCaches() ⇒ void

flushes the cache for each eventControlElement

Kind: global function
See: {EventControlElement.flushRectCache}

add(elements) ⇒ void

Adds an array of elements to the system. Calling this method from outside this class only makes sense in few cases, because changes to the element are not observed if isn't child of the baseElement.

Kind: global function

Param Type Description
elements Array.<object> Array of DOM elements. Only elements that pass the queryFilter are added.

getEventControlElement(domElement) ⇒ EventControlElement | void

finds the EventControlElement that belongs to a certain domElement

Kind: global function
Returns: EventControlElement | void - EventControlElement that belongs to a certain domElement if there is one

Param Type Description
domElement object DOM element which's EventControlElement is sought

addEventControlElement(domElement) ⇒ void

Similar to add(), but for a single DOM element and without query filters. Again, calling this method from outside this class only makes sense in few cases, because changes to the element are not observed if itn't child of the baseElement.

Kind: global function

Param Type Description
domElement object Element which's TransformableElement is about to be added to the array

listenToChangeCss(eventType, [modificationFunction], [additionalFilter], [postFunction]) ⇒ void

Adds an eventListener for each DOM element that matches the criteria.

Kind: global function

Param Type Default Description
eventType string type of the event that should be listened for. If null, you have to react to events manually, running doEvent(event).
[modificationFunction] function args=>[] returns an array of css changes. args contain absolute transformation origin and mouse position, both in arrays, and others. See {TransformationFunctions} for examples and predefined functions
[additionalFilter] string "'*'" css query that has to apply additionally to the one passed in the constructor
[postFunction] function (event, element)=>{} optional function that runs after the css change is successfully handled internally. See {PostTransformFunctions} for examples and predefined functions.

doEvent(event) ⇒ void

runs modification functions and postfunctions for all EventControlElements, if they have previously been passed via listenToChangeCss

Kind: global function

Param Type Description
event event event that co-triggered the call of the method