Show:

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

Core.ElementOutput

(
  • element
)
private

Parameters:

  • element Node

    document parent of this container

Item Index

Methods

attach

(
  • target
)
private

Assigns the DOM element for committing and to and attaches event listeners.

Parameters:

  • target Node

    document 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.

Parameters:

  • type String

    Event channel name

  • [payload] Object optional

    User defined data payload

on

(
  • type
  • handler
)

Adds a handler to the type channel which will be executed on emit.

Parameters:

  • type String

    DOM event channel name, e.g., "click", "touchmove"

  • handler Function

    Handler. It's only argument will be an emitted data payload.

removeListener

(
  • type
  • handler
)

Removes a previously added handler to the type channel. Undoes the work of on.

Parameters:

  • type String

    DOM event channel name e.g., "click", "touchmove"

  • handler Function

    Handler

set

(
  • sources
)

Inherited from Core.SizeNode but overwritten in

Introduce new data streams to the layout node in {key : value} pairs. Here the 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:

  • sources Object
    Object of data sources