mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-18 11:21:23 +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,
|
"default": et2_no_init,
|
||||||
"description": "Field width"
|
"description": "Field width"
|
||||||
},
|
},
|
||||||
|
"maxLength": {
|
||||||
|
"name": "Maximum length",
|
||||||
|
"type": "integer",
|
||||||
|
"default": et2_no_init,
|
||||||
|
"description": "Maximum number of characters allowed"
|
||||||
|
},
|
||||||
"blur": {
|
"blur": {
|
||||||
"name": "Placeholder",
|
"name": "Placeholder",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@ -57,6 +63,8 @@ var et2_textbox = et2_inputWidget.extend({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
legacyOptions: ["size", "maxLength"],
|
||||||
|
|
||||||
init: function() {
|
init: function() {
|
||||||
this._super.apply(this, arguments);
|
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) {
|
set_blur: function(_value) {
|
||||||
if(_value) {
|
if(_value) {
|
||||||
this.input.attr("placeholder", _value + "!"); // HTML5
|
this.input.attr("placeholder", _value + "!"); // HTML5
|
||||||
|
Loading…
Reference in New Issue
Block a user