Extends
Constructor
new ve.ui.DimensionsWidget([config])
#
Hierarchy
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: |
Methods
clear() → {ve.ui.DimensionsWidget}chainable
#
Set an empty value for the dimensions inputs so they show the placeholders if those exist.
Returns:
Set an empty value for the dimensions inputs so they show the placeholders if those exist.
getDimensions() → {ve.ui.DimensionsWidget.Dimensions}
#
Return the current dimension values in the widget
Returns:
dimensions The width and height values of the inputs
getHeight() → {string}
#
Get the current value in the height input
Returns:
Input value
- Type
- string
getWidth() → {string}
#
Get the current value in the width input
Returns:
Input value
- Type
- string
isEmpty() → {boolean}
#
Check whether the widget is empty.
Returns:
Both values are empty
- Type
- boolean
isReadOnly() → {boolean}
#
Check if the widget is read-only
Returns:
- Type
- boolean
onHeightChange(value)
#
Respond to height change, propagate the input change event
Parameters:
Name | Type | Description |
---|---|---|
value |
string | The new changed value |
Fires:
onWidthChange(value)
#
Respond to width change, propagate the input change event
Parameters:
Name | Type | Description |
---|---|---|
value |
string | The new changed value |
Fires:
removeDefaults() → {ve.ui.DimensionsWidget}chainable
#
Remove the default dimensions
Returns:
renderDefaults()
#
Render the default dimensions as input placeholders
reset() → {ve.ui.DimensionsWidget}chainable
#
Reset the dimensions to the default dimensions.
Returns:
setDefaults(dimensions) → {ve.ui.DimensionsWidget}chainable
#
Set default dimensions
Parameters:
Name | Type | Description |
---|---|---|
dimensions |
Object | Default dimensions, width and height |
Returns:
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:
|
Returns:
setDisabled(disabled) → {ve.ui.DimensionsWidget}chainable
#
Disable or enable the inputs
Parameters:
Name | Type | Description |
---|---|---|
disabled |
boolean | Set disabled or enabled |
Returns:
setHeight(value) → {ve.ui.DimensionsWidget}chainable
#
Set a value for the height input
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
Returns:
setReadOnly(readOnly) → {ve.ui.DimensionsWidget}chainable
#
Set the read-only state of the widget
Parameters:
Name | Type | Description |
---|---|---|
readOnly |
boolean | Make widget read-only |
Returns:
setValidityFlag() → {ve.ui.DimensionsWidget}chainable
#
Sets the 'invalid' flag appropriately on both text inputs.
Returns:
setWidth(value) → {ve.ui.DimensionsWidget}chainable
#
Set a value for the width input
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
Returns:
Type Definitions
Dimensions
#
Type:
Properties:
Name | Type | Description |
---|---|---|
width |
number | The value of the width input |
height |
number | The value of the height input |
Events
heightChange(value)
#
Parameters:
Name | Type | Description |
---|---|---|
value |
string | The new width |
widthChange(value)
#
Parameters:
Name | Type | Description |
---|---|---|
value |
string | The new width |