Class: Numberbox

Numberbox(container, oopt)

Class representing an Numberbox widget.

Constructor

new Numberbox(container, oopt)

Parameters:
Name Type Attributes Description
container object DOM container for the widget.
o object <optional>
Options.
Properties
Name Type Attributes Default Description
minVal number <optional>
null Minimum value.
maxVal number <optional>
null Maximum value.
precision number <optional>
0 Number of decimal places to use.
backgroundColor string <optional>
"#282828" The background color.
fontColor string <optional>
"#aaa" The font color.
fontSize string <optional>
"12px" The font size.
fontFamily string <optional>
"Arial" The font family.
appendString string <optional>
"" String to append to the value when displaying (i.e. " Hz").
Implements:
  • Widget
Source:

Methods

_editSelectAll()

Function called when 'select all' is invoked.
Source:

(private) _getPowerOfSelectedDigit(charNum) → {number}

Returns the power of the selected digit.
Parameters:
Name Type Description
charNum number The index of the selected digit.
Source:
Returns:
- Power of the selected digit.
Type
number

(private) _getSelectedCharNumber(clientX, clientY) → {number}

Returns the number of the selected character in the text box based on the client mouse x and y position.
Parameters:
Name Type Description
clientX number
clientY number
Source:
Returns:
- Index of the selected digit.
Type
number

(private) _initHandlers()

Initializes mouse and touch event handlers.
Source:

(private) _initOptions()

Initializes the options.
Source:

(private) _initState()

Initializes the state.
Source:

(private) _initStateConstraints()

Initializes state constraints.
Source:

(private) _initSvgEls()

Initializes the svg elements.
Source:

(private) _update()

Updates (redraws) components based on state.
Source:

getVal() → {number}

Returns the current value.
Source:
Returns:
- Current value.
Type
number

setInternalVal(newVal)

Sets the current value. Same as setVal(), but will not cause an observer callback trigger.
Parameters:
Name Type Description
newVal number The new value.
Source:

setVal(newVal)

Sets the current value. Same as setInternalVal(), but will cause an observer callback trigger.
Parameters:
Name Type Description
newVal number The new value.
Source:

toString() → {string}

Returns a string representation of the value.
Source:
Returns:
- String representation of the value.
Type
string