mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-18 20:39:13 +02:00
step attribute for number widget
This commit is contained in:
@@ -44,6 +44,7 @@ var et2_number = /** @class */ (function (_super) {
|
||||
var _this = _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_number._attributes, _child || {})) || this;
|
||||
_this.min = null;
|
||||
_this.max = null;
|
||||
_this.step = null;
|
||||
return _this;
|
||||
}
|
||||
et2_number.prototype.transformAttributes = function (_attrs) {
|
||||
@@ -115,6 +116,15 @@ var et2_number = /** @class */ (function (_super) {
|
||||
this.input.attr("max", this.max);
|
||||
}
|
||||
};
|
||||
et2_number.prototype.set_step = function (_value) {
|
||||
this.step = _value;
|
||||
if (this.step == null) {
|
||||
this.input.removeAttr("step");
|
||||
}
|
||||
else {
|
||||
this.input.attr("step", this.step);
|
||||
}
|
||||
};
|
||||
et2_number._attributes = {
|
||||
"value": {
|
||||
"type": "float"
|
||||
@@ -135,6 +145,12 @@ var et2_number = /** @class */ (function (_super) {
|
||||
"default": et2_no_init,
|
||||
"description": "Maximum allowed value"
|
||||
},
|
||||
"step": {
|
||||
"name": "step value",
|
||||
"type": "integer",
|
||||
"default": et2_no_init,
|
||||
"description": "Step attribute specifies the interval between legal numbers"
|
||||
},
|
||||
"precision": {
|
||||
// TODO: Implement this in some nice way other than HTML5's step attribute
|
||||
"name": "Precision",
|
||||
|
Reference in New Issue
Block a user