ch.Countdown
Description
Countdown counts the maximum of characters that user can enter in a form control. Countdown could limit the possibility to continue inserting charset.
How-to
Parameters
-
el
- HTMLElement : A HTMLElement to create an instance of ch.Countdown. -
options
- Object : Options to customize an instance.-
max
- Number : Number of the maximum amount of characters user can input in form control. Default: 500. -
plural
- String : Message of remaining amount of characters, when it's different to 1. The variable that represents the number to be replaced, should be a hash. Default: "# characters left.". -
singular
- String : Message of remaining amount of characters, when it's only 1. The variable that represents the number to be replaced, should be a hash. Default: "# character left.".
-
Extends
Properties
.Component#name
String
The name of a component.
.Countdown#name
String
The name of the component.
.trigger
HTMLTextAreaElement
The countdown trigger.
.uid
Number
A unique id to identify the instance of a component.
Methods
.constructor()
Returns a reference to the constructor function.
.destroy()
Destroys an instance of Component and remove its data from asociated element.
.disable() → {component}
Disables an instance of Component.
.enable() → {component}
Enables an instance of Component.
.require() → {component}
Adds functionality or abilities from other classes.
.constructor()
Returns a reference to the constructor function.
.destroy()
Destroys a Countdown instance.
Events
'destroy'
Emits when a component is destroyed.
'disable'
Emits when a component is disable.
'enable'
Emits when a component is enabled.
'exceed'
Event emitted when the lenght of characters is exceeded.
'ready'
Event emitted when the component is ready to use.