mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 17:19:06 +01:00
Implement legacy options size & max size
This commit is contained in:
parent
257f823773
commit
ae6809e91e
@ -36,6 +36,12 @@ var et2_textbox = et2_inputWidget.extend({
|
||||
"default": et2_no_init,
|
||||
"description": "Field width"
|
||||
},
|
||||
"maxLength": {
|
||||
"name": "Maximum length",
|
||||
"type": "integer",
|
||||
"default": et2_no_init,
|
||||
"description": "Maximum number of characters allowed"
|
||||
},
|
||||
"blur": {
|
||||
"name": "Placeholder",
|
||||
"type": "string",
|
||||
@ -57,6 +63,8 @@ var et2_textbox = et2_inputWidget.extend({
|
||||
}
|
||||
},
|
||||
|
||||
legacyOptions: ["size", "maxLength"],
|
||||
|
||||
init: function() {
|
||||
this._super.apply(this, arguments);
|
||||
|
||||
@ -115,6 +123,18 @@ var et2_textbox = et2_inputWidget.extend({
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Set maximum characters allowed
|
||||
* @param _size Max characters allowed
|
||||
*/
|
||||
set_maxLength: function(_size) {
|
||||
if (typeof _size != 'undefined' && _size != this.input.attr("maxlength"))
|
||||
{
|
||||
this.maxLength = _size;
|
||||
this.input.attr("maxLength", this.maxLength);
|
||||
}
|
||||
},
|
||||
|
||||
set_blur: function(_value) {
|
||||
if(_value) {
|
||||
this.input.attr("placeholder", _value + "!"); // HTML5
|
||||
|
Loading…
Reference in New Issue
Block a user