Global

Members

(constant) S

Source:

Global DOM Scheduler.

Methods

define_child_element(widget, name, config)

Source:

Creates a HTMLElement as a child for a widget. Is used to simplify widget definitions. E.g. the tiny marker used to display the back-end value is a simple DIV added using child element. The generic element is a DIV added to Widget.element with the class .aux-[name]. Default creating and adding can be overwritten with custom callback functions.

Parameters:
Name Type Description
widget Widget

The Widget to add the child element to.

name string

The identifier of the element. It will be prefixed by an underscore Widget["_" + config.name].

config object

The configuration of the child element.

Properties
Name Type Attributes Default Description
show boolean <optional>
false

Show/hide the child element on initialization.

option string <optional>
"show_"+config.name

A custom option of the parent widget to determine the visibility of the child element. If this is null, Widget.options["show_"+ config.name] is used to toggle its visibility. The child element is visible, if this options is !== false.

display_check function <optional>

A function overriding the generic show_option behavior. If set, this function is called with the value of show_option as argument as soon as it gets set and is supposed to return a boolean defining the visibility of the element.

append function <optional>

A function overriding the generic append mechanism. If not null, this function is supposed to take care of adding the child element to the parent widget's DOM.

create function <optional>

A function overriding the generic creation mechanism. If not null, this function is supposed to create and return a DOM element to be added to the parent widget.

toggle_class boolean <optional>
false

Defines if the parent widget receives the class .aux-has-[name] as soon as the child element is shown.

draw_options array <optional>

A list of options of the parent widget which are supposed to trigger a check if the element has to be added or removed.

draw function <optional>

A function to be called on redraw.

define_child_widget(widget, name, config)

Source:

Defines a Widget as a child for another widget. This function is used internally to simplify widget definitions. E.g. the Icon of a Button is defined as a child widget. Child widgets are created/added after the initialization of the parent widget. If not configured explicitly, all options of the child widget can be accessed via Widget.options[config.name + "." + option] on the parent widget.

Parameters:
Name Type Description
widget Widget

The Widget to add the ChildWidget to.

name string

The identifier of the element inside the parent element, Widget[config.name].

config object

The configuration of the child element.

Properties
Name Type Attributes Default Description
create Widget

A Widget class derivate to be used as child widget.

fixed boolean <optional>

A fixed child widget cannot be removed after initialization.

show boolean <optional>
false

Show/hide a non-fixed child widget on initialization.

option string <optional>
"show_"+config.name

A custom option of the parent widget to determine the visibility of the child element. If this is null, Widget.options["show_"+ config.name] is used to toggle its visibility. The child element is visible, if this options is !== false.

append function <optional>

A function overriding the generic append mechanism. If not null, this function is supposed to take care of adding the child widget to the parent widget's DOM. Otherwise the element of the child widget is added to the element of the parent widget.

inherit_options boolean <optional>
false

Defines if both widgets share the same set of options. If true, Setting an option on the parent widget also sets the same option on the child widget. If false, the options of the child widget can be accessed via options[config.name + "." + option] in the parent widget.

map_options array <optional>
[]

An array containing option names to be mapped between parent and child widget. If one of these options is set on the parent widget, it also gets set on the child widget. This is a fine-grained version of config.inherit-options.

userset_ignore boolean <optional>
false

Do not care about the userset event of the parent widget, only keep track of set.

userset_delegate boolean <optional>
false

Delegates all user interaction from the child to the parent element. If the user triggers an event on the child widget, the userset function of the parent element is called.

static_events array <optional>
[]

An array of static events to be added to the parent widget. Each entry is a mapping between the name of the event and the callback function.

toggle_class boolean <optional>
false

Defines if the parent widget receives the class .aux-has-[name] as soon as the child element is shown.

blacklist_options array.<string> <optional>

Array containing options names which are skipped on inherit_options.

map_interacting boolean <optional>
true

If true, the interacting property will be true if it is true in the child.

drawPath()

Source:

Draws an SVG path for the current frequency response curve.

getFilterFunctions()

Source:

Returns the functions representing the frequency response of all active filters.

invalidate(key)

Source:

Invalidates an option and triggers a redraw() call.

Parameters:
Name Type Description
key string

observeResize(cb)

Source:

Calls a callback whenever the widget resizes. This method will trigger one resize.

Parameters:
Name Type Description
cb function

subscribeOptions(parent, name, callback) → {function}

Source:

Subscribe to the set of options defined in the nearest AUX-OPTIONS component of a given name and parent.

Parameters:
Name Type Description
parent Node

Parent node. This is usually the parent node of the component which references a given set of options.

name String

Options name.

callback function

Callback to call when a set of options become available. Will be called with null as long as no options set can be found.

Returns:
  • Returns a function which must be called in order to unsubscribe from the options.
Type
function

subscribeOptionsAttributes(parent, name, callback) → {function}

Source:

Subscribe to the set of attributes defined by the inheritance chain of AUX-OPTIONS of a given name and parent.

Parameters:
Name Type Description
parent Node

Parent node. This is usually the parent node of the component which references a given set of options.

name String

Options name.

callback function

Callback to call when a set of options become available. Will be called with a Map of attributes.

Returns:
  • Returns a function which must be called in order to unsubscribe from the options.
Type
function