Mixin: LabelElement

.ui.mixin.LabelElement

LabelElement is often mixed into other classes to generate a label, which helps identify the function of an interface element. See the OOjs UI documentation on MediaWiki for more information.

Source:

Methods

getLabel() → {jQuery|string|function|null}

Get the label.

Source:
Returns:

Label nodes; text; a function that returns nodes or text; or null for no label

Type
jQuery | string | function | null

setHighlightedQuery(text, query, compareopt)

Set the label as plain text with a highlighted query

Parameters:
Name Type Attributes Description
text string

Text label to set

query string

Substring of text to highlight

compare function <optional>

Optional string comparator, e.g. Intl.Collator().compare

Source:

setLabel(label)

Set the label.

An empty string will result in the label being hidden. A string containing only whitespace will be converted to a single &nbsp;.

Parameters:
Name Type Description
label jQuery | string | OO.ui.HtmlSnippet | function | null

Label nodes; text; a function that returns nodes or text; or null for no label

Source:

setLabelElement($label)

Set the label element.

If an element is already set, it will be cleaned up before setting up the new element.

Parameters:
Name Type Description
$label jQuery

Element to use as label

Source: