Typedef
Static Public Summary | ||
public |
This callback is used in forEach callback iteration on a Collection. |
|
public |
This callback is used in rule validation for InputElement. |
|
public |
Object used to store the validation rules on an InputElement. |
|
public |
Any vanilla object that is on the form of a paired key/value structure : |
|
public |
A read-only object that parses position and size informations about an HtmlElement. |
Static Public
public ForEachCallback: Function source
This callback is used in forEach callback iteration on a Collection.
The callback is provided with two parameters :
- element {HtmlElement} Current element in the iteration
- index {Number} Index of the current iterated element
public InputRuleCallback: Function source
This callback is used in rule validation for InputElement.
The callback is provided with the InputElement context. You can then call
this.value
to fetch InputElement value.
It must return true
if validates or false
otherwise.
Example:
var i = new Element('<input type="text">');
i.rule('myRule', function() {
return this.value > 5;
}, 'value must be over 5');
i.value = 3;
i.validate(); // returns false
console.log(i.errors); // outputs {myRule: 'value must be over 5'}
public InputValidationRules: Object source
Object used to store the validation rules on an InputElement.
Properties:
Name | Type | Attribute | Description |
pattern | RegExp | CSSSelector | Pattern used for regexp or CSS Selector with |
|
message | string | Message stored with the rule (usually an error Key for i18n to user) |
public KeyValueObject: Object source
Any vanilla object that is on the form of a paired key/value structure :
Example:
{
key1: value1,
key2: value2,
[...],
keyN: valueN
}
public NodeMetrics: Object | DOMRect source
A read-only object that parses position and size informations about an HtmlElement. The position is relative to viewport. If you want absolute positionning on a page, you must also use scrollX and scrollY values
Properties:
Name | Type | Attribute | Description |
left | Number | Left offset from viewport in pixels |
|
top | Number | Top offset from viewport in pixels |
|
right | Number | Right offset from viewport in pixels |
|
bottom | Number | Bottom offset from viewport in pixels |
|
width | Number | Width in pixels |
|
height | Number | Height in pixels |
|
outerWidth | Number | Outer width in pixels |
|
outerHeight | Number | Outer height in pixels |
|
scrollX | Number | Offset of the viewport from left in pixels |
|
scrollY | Number | Offset of the viewport from top in pixels |