Expand all

ve.ui.MWMediaInfoFieldWidget

Extends

Constructor

new ve.ui.MWMediaInfoFieldWidget(content, [config]) #

MWMediaInfoFieldWidget widget for displaying media information from the API.

Parameters:

Name Type Attributes Description
content jQuery | string | OO.ui.HtmlSnippet

API response data from which to build the display

config Object optional

Configuration options

Properties:
Name Type Attributes Default Description
href string optional

A url encapsulating the field text. If a label is attached it will include the label.

labelMsg string optional

A ve.msg() label string for the field.

isDate boolean optional
false

Field text is a date that will be converted to 'fromNow' string.

type string optional
'attribute'

Field type, either 'description' or 'attribute'

descriptionHeight string optional
'4em'

Height limit for description fields

Mixes in:
Source:
MWMediaInfoFieldWidget widget for displaying media information from the API.

Properties

thresholdstatic #

Define a height threshold for the description fields. If the rendered field's height is under the defined limit (max-height + threshold) we should remove the max-height and display the field as-is. This prevents cases where "read more" appears but only exposes only a few pixels or a line extra.

Properties:

Name Type Description
Threshold number

in pixels

Source:
Define a height threshold for the description fields.

Methods

getType() → {string} #

Get field type; 'attribute' or 'description'

Source:

Returns:

Field type

Type
string
Get field type; 'attribute' or 'description'

initialize() #

Toggle the read more button according to whether it should be visible or not.

Source:

Toggle the read more button according to whether it should be visible or not.

onReadMoreClick() #

Respond to read more button click event.

Source:
Respond to read more button click event.