new StyleService( instanceName, config )

Description

Update a style element every time monitored elements change.

Parameters
Name Type Description
instanceName string

Custom portion of this instance.

config NexusHoratio.web.StyleService~Config

Instance configuration.

Members


logger :NexusHoratio.base.Logger


name :string

Details
string

shortName :string

Methods


activate()


deactivate()


on( eventType, func ) → {NexusHoratio.base.Service}

Description

Attach a function to an eventType.

Parameters
Name Type Description
eventType NexusHoratio.base.Dispatcher~EventType

Event type to connect with.

func NexusHoratio.base.Dispatcher~Handler

Single argument function to call.

Returns

This instance, for chaining.


off( eventType, func ) → {NexusHoratio.base.Service}

Description

Remove all instances of a function registered to an eventType.

Parameters
Name Type Description
eventType NexusHoratio.base.Dispatcher~EventType

Event type to disconnect from.

func NexusHoratio.base.Dispatcher~Handler

Function to remove.

Returns

This instance, for chaining.


allowReactivation( allow ) → {NexusHoratio.base.Service}

Parameters
Name Type Description
allow boolean

Whether to allow this service to be activated when already active.

Returns

This instance, for chaining.


setShortName( shortName ) → {NexusHoratio.base.Service}

Parameters
Name Type Description
shortName string

Custom name portion of this instance.

Returns

This instance, for chaining.

Type Definitions


ElementMap

Details
Map.<string, external:Element>

StyleProperties

Description

CSS style properties.

Details
Map.<string, string>

Finder() → {NexusHoratio.web.StyleService~ElementMap}

Description

Function that finds DOM elements.

Returns
Details
function

ElementsProcessor( elements ) → {NexusHoratio.web.StyleService~StyleProperties}

Description

Function that examines multiple elements to compute a style.

Parameters
Name Type Description
elements NexusHoratio.web.StyleService~ElementMap

Elements to examine.

Returns

Style properties for to contribute.

Details
function

Config

Properties
Name Type Attributes Default Description
className string

Name for the class to control.

finder NexusHoratio.web.StyleService~Finder

Function to find the elements to monitor.

elementsProcessor NexusHoratio.web.StyleService~ElementsProcessor

Function that examines multiple elements to compute a style.

events Array.<string> <optional>
[]

List of Element events to listen to on the elements.

Details
object

Events


activate


activated


deactivate


deactivated