Core.ElementOutput Class
samsara/core/ElementOutput.js:20
Responsible for committing CSS3 properties to the DOM and providing DOM event hooks from a provided DOM element. Where Surface's API handles inputs from the developer from within Samsara, ElementOutput handles the DOM interaction layer.
Constructor
Methods
attach
-
target
Assigns the DOM element for committing and to and attaches event listeners.
Parameters:
-
targetNodedocument parent of this container
detach
()
private
Removes the associated DOM element in memory and detached event listeners.
emit
-
type -
[payload]
Emit an event with optional data payload. This will execute all listening to the channel name with the payload as only argument.
on
-
type -
handler
Adds a handler to the type channel which will be executed on emit.
removeListener
-
type -
handler
Removes a previously added handler to the type channel.
Undoes the work of on.
set
-
sources
key is one of "transform", "origin", "align" or "opacity".
The value is either a stream, or a simple type like a Number or Array.
Simple types will be wrapped in an Observerable to emit appropriate events.
Parameters:
-
sourcesObjectObject of data sources