Class: MediaTrigger

WinJSContrib.UI. MediaTrigger

new MediaTrigger(items, linkedControl)

Trigger events on media queries. This class is usefull as a component for other controls to change some properties based on media queries

Parameters:
Name Type Description
items Object

object containing one property for each query

linkedControl Object

control linked to media trigger

Source:

Methods

addEventListener(type, listener, useCapture)

Adds an event listener to the control.

Parameters:
Name Type Description
type

The type (name) of the event.

listener

The listener to invoke when the event gets raised.

useCapture

If true, initiates capture, otherwise false.

Source:

dispatchEvent(type, eventProperties)

Raises an event of the specified type and with the specified additional properties.

Parameters:
Name Type Description
type

The type (name) of the event.

eventProperties

The set of additional properties to be attached to the event object when the event is raised.

Source:
Returns:

true if preventDefault was called on the event.

registerMediaEvent(name, query, data)

register an event from a media query

Parameters:
Name Type Description
name string

event name

query string

media query

data Object

data associated with this query

Source:

removeEventListener(type, listener, useCapture)

Removes an event listener from the control.

Parameters:
Name Type Description
type

The type (name) of the event.

listener

The listener to remove.

useCapture

true if capture is to be initiated, otherwise false.

Source: