Expand all

ve.ui.DimensionsWidget

Extends

Constructor

new ve.ui.DimensionsWidget([config]) #

Widget that visually displays width and height inputs. This widget is for presentation-only, no calculation is done.

Parameters:

Name Type Attributes Description
config Object optional

Configuration options

Properties:
Name Type Attributes Default Description
defaults Object optional

Default dimensions

validate Object optional

Validation pattern passed to TextInputWidgets

readOnly boolean optional
false

Prevent changes to the value of the widget.

Source:
Widget that visually displays width and height inputs.

Methods

clear() → {ve.ui.DimensionsWidget}chainable #

Set an empty value for the dimensions inputs so they show the placeholders if those exist.

Source:

Returns:

Type
ve.ui.DimensionsWidget

Set an empty value for the dimensions inputs so they show the placeholders if those exist.

getDefaults() → {Object} #

Get the default dimensions

Source:

Returns:

Default dimensions

Type
Object
Get the default dimensions

getDimensions() → {ve.ui.DimensionsWidget.Dimensions} #

Return the current dimension values in the widget

Source:

Returns:

dimensions The width and height values of the inputs

Type
ve.ui.DimensionsWidget.Dimensions
Return the current dimension values in the widget

getHeight() → {string} #

Get the current value in the height input

Source:

Returns:

Input value

Type
string
Get the current value in the height input

getWidth() → {string} #

Get the current value in the width input

Source:

Returns:

Input value

Type
string
Get the current value in the width input

isEmpty() → {boolean} #

Check whether the widget is empty.

Source:

Returns:

Both values are empty

Type
boolean
Check whether the widget is empty.

isReadOnly() → {boolean} #

Check if the widget is read-only

Source:

Returns:

Type
boolean
Check if the widget is read-only

onHeightChange(value) #

Respond to height change, propagate the input change event

Parameters:

Name Type Description
value string

The new changed value

Source:

Fires:

Respond to height change, propagate the input change event

onWidthChange(value) #

Respond to width change, propagate the input change event

Parameters:

Name Type Description
value string

The new changed value

Source:

Fires:

Respond to width change, propagate the input change event

removeDefaults() → {ve.ui.DimensionsWidget}chainable #

Remove the default dimensions

Source:

Returns:

Type
ve.ui.DimensionsWidget
Remove the default dimensions

renderDefaults() #

Render the default dimensions as input placeholders

Source:
Render the default dimensions as input placeholders

reset() → {ve.ui.DimensionsWidget}chainable #

Reset the dimensions to the default dimensions.

Source:

Returns:

Type
ve.ui.DimensionsWidget
Reset the dimensions to the default dimensions.

setDefaults(dimensions) → {ve.ui.DimensionsWidget}chainable #

Set default dimensions

Parameters:

Name Type Description
dimensions Object

Default dimensions, width and height

Source:

Returns:

Type
ve.ui.DimensionsWidget
Set default dimensions

setDimensions(dimensions) → {ve.ui.DimensionsWidget}chainable #

Set the dimensions value of the inputs

Parameters:

Name Type Description
dimensions Object

The width and height values of the inputs

Properties:
Name Type Description
width number

The value of the width input

height number

The value of the height input

Source:

Returns:

Type
ve.ui.DimensionsWidget
Set the dimensions value of the inputs

setDisabled(disabled) → {ve.ui.DimensionsWidget}chainable #

Disable or enable the inputs

Parameters:

Name Type Description
disabled boolean

Set disabled or enabled

Source:

Returns:

Type
ve.ui.DimensionsWidget
Disable or enable the inputs

setHeight(value) → {ve.ui.DimensionsWidget}chainable #

Set a value for the height input

Parameters:

Name Type Description
value string
Source:

Returns:

Type
ve.ui.DimensionsWidget
Set a value for the height input

setReadOnly(readOnly) → {ve.ui.DimensionsWidget}chainable #

Set the read-only state of the widget

Parameters:

Name Type Description
readOnly boolean

Make widget read-only

Source:

Returns:

Type
ve.ui.DimensionsWidget
Set the read-only state of the widget

setValidityFlag() → {ve.ui.DimensionsWidget}chainable #

Sets the 'invalid' flag appropriately on both text inputs.

Source:

Returns:

Type
ve.ui.DimensionsWidget
Sets the 'invalid' flag appropriately on both text inputs.

setWidth(value) → {ve.ui.DimensionsWidget}chainable #

Set a value for the width input

Parameters:

Name Type Description
value string
Source:

Returns:

Type
ve.ui.DimensionsWidget
Set a value for the width input

Type Definitions

Dimensions #

Type:

Properties:

Name Type Description
width number

The value of the width input

height number

The value of the height input

Source:

Events

heightChange(value) #

Parameters:

Name Type Description
value string

The new width

Source:

widthChange(value) #

Parameters:

Name Type Description
value string

The new width

Source: